From 2d0cb7198b42208d24bc8222cecb63c77e3c1744 Mon Sep 17 00:00:00 2001 From: hayao Date: Fri, 6 Aug 2021 20:31:57 +0900 Subject: [PATCH] [fix] : Do not use for (of) --- sanmoku/script/judgement.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sanmoku/script/judgement.js b/sanmoku/script/judgement.js index 67eef00..20b3a19 100644 --- a/sanmoku/script/judgement.js +++ b/sanmoku/script/judgement.js @@ -4,13 +4,21 @@ // https://teratail.com/questions/352619 const CountArrayValue = function(array, number) { let count = {}; - for (let i of array) { - count[i] = (count[i] || 0) + 1; - if (count[i] == number) return true; + + //for (let i of array) { + // count[i] = (count[i] || 0) + 1; + // if (count[i] == number) return true; + //} + + for (i=0; i