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 Updates
APA

Stefan Judis | Sciencx (2021-01-16T23:00:00+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 ,<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 ]. 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 . 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: ]
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/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.