Array.prototype.at is on its way (#note)

I just saw that Array.prototype.at will ship in Chrome 89 and Firefox 85. How do I know? I’m watching the MDN browser combat data repo on GitHub. ?
const numbers = [1, 2, 3];

// old way to access array elements from the end
numbers…


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

I just saw that Array.prototype.at will ship in Chrome 89 and Firefox 85. How do I know? I'm watching the MDN browser combat data repo on GitHub. ?

const numbers = [1, 2, 3];

// old way to access array elements from the end
numbers[numbers.length - 1]; // 3

// new way to access array elements from the end
numbers.at(-1); // 3

That's a welcome addition to the language! ?

Additional resources:


Reply to Stefan


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis


Print Share Comment Cite Upload Translate
APA
Stefan Judis | Sciencx (2022-12-09T04:53:13+00:00) » Array.prototype.at is on its way (#note). Retrieved from https://www.scien.cx/2021/01/16/array-prototype-at-is-on-its-way-note/.
MLA
" » Array.prototype.at is on its way (#note)." Stefan Judis | Sciencx - Saturday January 16, 2021, https://www.scien.cx/2021/01/16/array-prototype-at-is-on-its-way-note/
HARVARD
Stefan Judis | Sciencx Saturday January 16, 2021 » Array.prototype.at is on its way (#note)., viewed 2022-12-09T04:53:13+00:00,<https://www.scien.cx/2021/01/16/array-prototype-at-is-on-its-way-note/>
VANCOUVER
Stefan Judis | Sciencx - » Array.prototype.at is on its way (#note). [Internet]. [Accessed 2022-12-09T04:53:13+00:00]. Available from: https://www.scien.cx/2021/01/16/array-prototype-at-is-on-its-way-note/
CHICAGO
" » Array.prototype.at is on its way (#note)." Stefan Judis | Sciencx - Accessed 2022-12-09T04:53:13+00:00. https://www.scien.cx/2021/01/16/array-prototype-at-is-on-its-way-note/
IEEE
" » Array.prototype.at is on its way (#note)." Stefan Judis | Sciencx [Online]. Available: https://www.scien.cx/2021/01/16/array-prototype-at-is-on-its-way-note/. [Accessed: 2022-12-09T04:53:13+00:00]
rf:citation
» Array.prototype.at is on its way (#note) | Stefan Judis | Sciencx | https://www.scien.cx/2021/01/16/array-prototype-at-is-on-its-way-note/ | 2022-12-09T04:53:13+00:00
https://github.com/addpipe/simple-recorderjs-demo