String.prototype.codePointAt

Returns a non-negative integer representing the Unicode code point at the given index If there is no element at that position, the result is undefined. If a valid UTF-16 surrogate pair does not begin at index, the result is the code unit at index.

Syntax

codePointAt(index)

Parameters

Return value

A number less in the range from 0 to 1114112.

If the index is out of bounds, returns undefined.

Examples

"ABC".codePointAt(1)
66