The string value to retrieve a character from.
The zero-based index of the character to return. A negative index counts from
the end of the string: -1 returns the last character, -2 the second-to-last, and so on.
A single-character string at the given index, or undefined if the index is out of
range.
The
strAt()method takes an integer value and returns a new string consisting of the single UTF-16 code unit located at the specified offset into the string. It accepts both positive and negative integers: negative integers count back from the last string character.This is the equivalent of
String.prototype.at()and falls back to polyStrAt in environments where the native method is unavailable.