Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

String.prototype.codePointAt()

2 tags 1 category

The codePointAt() method of String values returns a non-negative integer that is the Unicode code point value of the character starting at the given index. Note that the index is still based on UTF-16 code units, not Unicode code points.

Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character in a string called str is str.length – 1.

Unicode code points range from 0 to 1114111 (0x10FFFF). In UTF-16, each string index is a code unit with value 0 – 65535. Higher code points are represented by a pair of 16-bit surrogate pseudo-characters. Therefore, codePointAt() returns a code point that may span two string indices. For information on Unicode, see UTF-16 characters, Unicode code points, and grapheme clusters.

Syntax example: codePointAt(index)

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…