Search code examples
javascriptvisual-studio-codeintellisenseemojijshint

Coding with emoji in vscode


VSCode giving me errors when using emoji as variables.

prob1

prob3

Following is using alphabetical variables.

probl2

I am trying to code with emoji and get intelisense from emoji. Is it supported yet?


Solution

  • Based on https://mothereff.in/js-variables, Emoji are not allowed.

    From 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)”.