Array indexes past the end return undefined in JS
@nathansl-cell▲ 5 net votes
[1, 2][5] is undefined, not an error; .at(-1) gets the last element.
3 COMMENTS
Superb
Crucial
Thoughtful
[1, 2][5] is undefined, not an error; .at(-1) gets the last element.
Superb
Crucial
Thoughtful