3 ms·
I think the issue is that the arrays are allowed to have holes: test = new Array(2) -> Array [ <2 empty slots> ] test[1] = true -> true t
by patates 2y ago
I think the issue is that the arrays are allowed to have holes:
test = new Array(2)
-> Array [ <2 empty slots> ]
test[1] = true
-> true
test.length
-> 2
test[0]
-> undefined
test[3]
-> undefined
test.some(x => x)
-> true
delete test[1]
-> true
test.some(x => x)
-> false