The JavaScript .at() method was introduced in the August release of the ECMA International TC39’s relative indexing proposal. It allows developers to grab elements based on their indexes. In this tutorial, we’ll look at the benefits of the method and how it can improve developers’ experiences.
Table of contents
The JavaScript .at() Method Will Change the Way You Handle Strings and ArraysThe indexable object prototypeExisting methods for getting list elementsUsing the length propertyThe slice() methodWhy not access the last array element with arr[-1] ?The .at() syntaxThe .at() method in practiceWorking with the returned value of a functionThe .at() method accepts numbers with a decimalConclusionSort: