JavaScript At_method Guide
The .at() method provides relative indexing for arrays and strings, supporting negative indices from the end. The guide walks through .at() Method. `arr.at(-1)` — last element (no more `arr[arr.length-1]`). `arr.at(0)` — first. `arr.at(-2)` — second to last. Strings: `"hello".at(-1)` = "o". Works on: Array, String, TypedArray. Safer than negative bracket access which returns undefined. Simplifies code for accessing elements from the end. The guide is organized into 1 sections that build on each other, each pairing a prose explanation with runnable code. Related guides: Arrays, Strings, Numbers, Math, Date. This is one of 145 JavaScript guides on JS Reference — see the full list on the guides page. Practice what you learn in the JavaScript playground, and look up any unfamiliar term in the JavaScript glossary.