When I do
const arrayLike = { 1:'foo', 2:'bar', length:2 };
Array.from(arrayLike);
I get
[ undefined, 'foo' ]
When I do
const arrayLike = { 1:'foo', 2:'bar', length:3 };
Array.from(arrayLike)
I get
[ undefined, 'foo', 'bar' ]
- Why do I not see
barwhen I set the length? - Why do I see only my elements only when I hard-set the length to 3?
- Why is the first element showing up as
undefined?