In brief
The index remains a position in the UTF-16 representation of the string.
Useful to know
codePointAt() returns the Unicode code point at a specified position. In case of a symbol outside the Basic Multilingual Plane, the method can read the pair of UTF-16 units if the index points to the its beginning. [1]
For example, "😀".codePointAt(0) is 128512. This does not mean that every visible sign consists of one code point: combinations of emoji and diacritics can be more complex. To limit visible symbols or move a cursor, grapheme segmentation is needed, not just an increase in a number index.
Sources
For further detail and to check the information: