StringcodePointAt
The method `String.prototype.codePointAt()` is a built-in JavaScript function that returns the Unicode code point value of a specific character in a string. Introduced in ECMAScript 2015 (ES6), it addresses limitations in the older `charCodeAt()` method by correctly handling surrogate pairs, which are used to represent characters outside the Basic Multilingual Plane (BMP) in UTF-16 encoding.
The function takes a single argument, `position`, which specifies the index of the character in the string.
For example, calling `codePointAt(0)` on the string `"๐จโ๐ฉโ๐งโ๐ฆ"` (a single emoji family) returns `0x1F468`, the full Unicode
This method is particularly useful when working with strings containing characters outside the BMP, such as