Skip to content

Instantly share code, notes, and snippets.

@thekevinscott
Last active October 29, 2016 17:31
Show Gist options
  • Save thekevinscott/c6d7511bb078dfda54785974ddf8d0de to your computer and use it in GitHub Desktop.
Save thekevinscott/c6d7511bb078dfda54785974ddf8d0de to your computer and use it in GitHub Desktop.
// From string to decimal code point
'A'.codePointAt(0)
> 65
// From decimal to hexadecimal code point
Number(65).toString(16);
> 41
// From hexadecimal to decimal code point
parseInt('41',16)
> 65
// alternatively
0x0041
> 65
// From decimal code point to string
String.fromCodePoint(65)
> 'A'
// From hexadecimal code point to string
'\u0041'
> 'A'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment