Standard built-ins
String.prototype.at()
Reads a UTF-16 unit at a relative index; a negative index counts from length. Out of bounds returns undefined.
Formal Syntax & Structure
javascript syntaxjavascript
text.at(index)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| index | Number | Index converted to an integer. |
Return Value
String | undefined
One code unit or undefined.
Working Example
Example Snippetjavascript
console.log("abc".at(-1));