Skip to content

Instantly share code, notes, and snippets.

@sugamasao
Created January 17, 2018 15:59
Show Gist options
  • Save sugamasao/0fd90f88ee641733a8cb3e6a88ce5b9e to your computer and use it in GitHub Desktop.
Save sugamasao/0fd90f88ee641733a8cb3e6a88ce5b9e to your computer and use it in GitHub Desktop.
javascriptでサロゲートペアを考慮したループとcode pointの取得
for(let c of 'い𩸽あ😇'){
console.log(c.charCodeAt(0).toString(16), c.charCodeAt(1).toString(16))
}
3044 NaN
d867 de3d
3042 NaN
d83d de07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment