codePointAt0
codePointAt0 is a concept used in programming libraries to obtain the Unicode code point at the start of a string, i.e., at position 0. It is commonly implemented as a wrapper or alias for a function that returns the first Unicode code point, taking into account how characters are encoded in the underlying string representation.
In languages that use UTF-16 encoding for strings, codePointAt0 may need to inspect two code units in
In JavaScript, the equivalent operation is String.prototype.codePointAt(0). It returns the numeric Unicode code point value at
By contrast, charCodeAt(0) returns the UTF-16 code unit at index 0, which may be a single surrogate
Examples: 'A'.codePointAt(0) yields 65; '𝄞'.codePointAt(0) yields 0x1D11E. Some APIs name the functionality differently or provide wrappers