![]() |
VOOZH | about |
JavaScript string codePointAt() is an inbuilt method in JavaScript that is used to return a non-negative integer value i.e, the method returns the Unicode value at an index (position) in a string.
string.codePointAt(A)Example: This example shows the basic use of the string.codePointAt() Method in javascript.
103 102 103
Example 2: The output of the example comes out to be undefined as the third index does not exist.
undefined
Example 3: The example iterates over each character in the string "GeeksforGeeks" and prints the Unicode code point value for each character.
71 101 101 107 115 102 111 114 71 101 101 107 115
Example 4: In this example, the codePointAt() method is used to get the Unicode code point value of a supplementary character (in this case, the star emoji "????").
63
We have a complete list of Javascript string methods, to check those please go through this article.