10 ms·
I think you're misinterpreting how for-of works. For-of will iterate over deleted keys in the exact same way that it iterates over keys that never existed.
by Dylan16807 3y ago
I think you're misinterpreting how for-of works. For-of will iterate over deleted keys in the exact same way that it iterates over keys that never existed.
let a = [];
a[7] = 7;
for (let v of a) console.log(v);
> undefined, undefined, undefined, undefined, undefined, undefined, undefined, 7