News for hackers. Stuff that matters.
Re:Stage 3 Proposal: Array.prototype.at by franciscop on Wednesday June 02, 2021 @08:57AM (#27368143)
This works, but not the way you'd think:

    const arr = [];
    arr[-1] = 'Hello world';
    console.log(arr[-1]);
    // Hello world
Instead of using the negative index, it stringifies the "-1" and uses it as the key of an object both when writing and reading. Thus, arr.length still remains 0

There are no comments on this comment yet.