String.prototype.at

Returns the UTF-16 code unit at the given index as a string. If the index is negative, counts back from the last code unit.

Syntax

at(index)

Parameters

Return value

A code unit as a string or undefined.

Example

"spring".at(1)
"p"
"spring".at(-1)
"g"