Character code

suggest change

The method charCodeAt retrieves the Unicode character code of a single character:

var charCode = "µ".charCodeAt(); // The character code of the letter µ is 181

To get the character code of a character in a string, the 0-based position of the character is passed as a parameter to charCodeAt:

var charCode = "ABCDE".charCodeAt(3); // The character code of "D" is 68

Some Unicode symbols don’t fit in a single character, and instead require two UTF-16 surrogate pairs to encode. This is the case of character codes beyond 216 - 1 or 63553. These extended character codes or code point values can be retrieved with codePointAt:

// The Grinning Face Emoji has code point 128512 or 0x1F600
var codePoint = "😀".codePointAt();

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Strings:
* Syntax
* Character code

Table Of Contents
8 Strings
11 Arrays
12 Objects
14 Classes
16 Map
17 Set
24 Loops
27 Date
29 Scope
30 AJAX
35 Cookies
41 JSON
44 Fetch
45 Modules
46 Screen
64 Console
68 Symbols
73 Modals
76 Events
86 Proxy
89 WeakMap
90 WeakSet
102 Tilde