Character Code in JavaScript

Level 131 keystrokes

charCodeAt(0) returns the UTF-16 code of the first character of "A" and prints 65.

JavaScript code

// charCodeAt(i) returns the UTF-16 code of the character at index i (0 = first)
// "A" is 65 ("a" is 97); String.fromCharCode(65) converts it back
1console.log("A".charCodeAt(0));

Output

65
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this JavaScript code and how often they appear.

  • .× 2
  • "× 2
  • (× 2
  • )× 2
  • ;× 1

More JavaScript examples at level 1

← JavaScript typing practice