判断数组中有几个相同的值
let a = [true, false, true, false, false, true, true] let b = [false, true, false, false] let d = [] let e = 0 for (var i = 0; i < a.length; i++) { let isSore = true if (a[i] == true) { isSore = false d.push(a[i]) } } console.log(d.length);