Published at
Updated at
Reading time
1min

I just saw that Array.prototype.at will ship in Chrome 89 and Firefox 85. How do I know? I'm following 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! ๐ŸŽ‰

Update: one year after publishing this post and this new valuable Array method is almost ready for prime time! Here's the up-to-date MDN browser compat data:

MDN Compat Data (source)
Browser support info for Array.prototype.at()
chromechrome_androidedgefirefoxfirefox_androidsafarisafari_iossamsunginternet_androidwebview_android
929292909015.415.416.092

Additional resources:

Was this post helpful?
Yes? Cool! You might want to check out Web Weekly for more WebDev shenanigans. The last edition went out 6 days ago.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles