javascript - 在 vscode 中使用表情符号编码

标签 javascript visual-studio-code intellisense emoji jshint

VSCode 在使用表情符号作为变量时出现错误。

prob1

prob3

以下是使用字母变量。

probl2

我正在尝试使用表情符号进行编码并从表情符号中获取智能感知。现在还支持吗?

最佳答案

基于 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/

相关文章:

ssh - vscode 远程支持双 ssh 吗?

c# - XAML 中的触发器属性

javascript - 如何使用 Canvas 创建半水滴和半砖图案

javascript - 调用PhantomJs函数

javascript - JavaScript 中基于构造函数的继承

visual-studio - Visual Studio 2010 智能感知工具提示延迟

visual-studio - 如何使 Eclipse 内容辅助行为类似于 Visual Studio 的 IntelliSense

javascript - 如何使用nify javascript制作圆 Angular 框?我正在使用但不工作

python - Visual Studio Code中TensorFlow导入错误

visual-studio-code - 如何使 vs 代码文件夹图标更大且文本变为白色?