最佳答案
基于 https://mothereff.in/js-variables , 不允许使用表情符号。
来自 https://mathiasbynens.be/notes/javascript-identifiers
What is allowed in an identifier name?
An identifier must start with $, _, or any character in the Unicode categories “Uppercase letter (Lu)”, “Lowercase letter (Ll)”, “Titlecase letter (Lt)”, “Modifier letter (Lm)”, “Other letter (Lo)”, or “Letter number (Nl)”.
The rest of the string can contain the same characters, plus any U+200C zero width non-joiner characters, U+200D zero width joiner characters, and characters in the Unicode categories “Non-spacing mark (Mn)”, “Spacing combining mark (Mc)”, “Decimal digit number (Nd)”, or “Connector punctuation (Pc)”.
关于javascript - 在 vscode 中使用表情符号编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55094339/