const a = [1, 2, 3]
const b = [4, 5, [1, 2, [3]], 4]
function isCompare(a, b) {
const rez = {}
b.forEach( i => {
rez[i] = Array.isArray(i) ? isCompare(a, i) : a === i
})
return rez
}
a.forEach(i => {
console.log(isCompare(i, b))
})
现在我得到了对象,我不知道该怎么做
1 === 1 正确 1 === 2 错误