News for hackers. Stuff that matters.
Re:Stage 3 Proposal: Array.prototype.at by twoodfin on Wednesday June 02, 2021 @08:38AM (#27367974)
A quick read suggests that it adds negative indexing from the end of the array.
Re:Stage 3 Proposal: Array.prototype.at by Pxtl on Wednesday June 02, 2021 @08:45AM (#27368039)
Imho that violates the principle of least astonishment - that "at" would have such different behavior from "[]" for negative numbers.
Re:Stage 3 Proposal: Array.prototype.at by ZephyrBlu on Wednesday June 02, 2021 @08:56AM (#27368132)
That's the whole point of this though... Currently you can't use negative indexes, but this would make them usable.
Re:Stage 3 Proposal: Array.prototype.at by Pxtl on Wednesday June 02, 2021 @04:44PM (#27373797)
Oh, I'd assumed main point was to provide a composable function.