Javascript literals for characters higher than U+FFFF
问题 My javsacript source code is strictly ascii and I want to represent the anger symbol in a string literal. Is that possible in javascript? 回答1: JavaScript strings are effectively UTF-16, so you can write the surrogate pair using Unicode escapes: "\uD83D\uDCA2" (this is what's shown on that page for the Java source code, which also works in JavaScript). As of ES2015 (ES6), you can also write it as \u{1F4A2} rather than working out the surrogate pairs (spec). Example: Using \uD83D\uDCA2 :