Skip to content

Instantly share code, notes, and snippets.

@kitak
Created November 1, 2016 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitak/8061227228bef920b42d4ed6dd151c80 to your computer and use it in GitHub Desktop.
Save kitak/8061227228bef920b42d4ed6dd151c80 to your computer and use it in GitHub Desktop.
サロゲートペアの文字を扱う
String.fromCodePoint(parseInt("1f376", 16))
String.fromCodePoint(0x1F376)
// "🍶"
Array.from("🍶🍣")
// ["🍶", "🍣"]
"🍶".codePointAt(0).toString(16)
// "1f376"
@kitak
Copy link
Author

kitak commented Nov 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment