4 ms·
Those don't skip null or undefined though, they only skip missing keys in the array. For example: [1,,3].length // 3 [1,,3].forEach(v => console.log(v)
by jffry 5y ago
Those don't skip null or undefined though, they only skip missing keys in the array. For example:
[1,,3].length
// 3
[1,,3].forEach(v => console.log(v))
// 1
// 3
[1,undefined,null,3].forEach(v => console.log(v))
// 1
// undefined
// null
// 3