operators - Why # character is special in javascript? -
most of characters prohibited part of variable names in js have special meaning:
- &, *, %, ^, etc. operators;
- @ used declaring decorators;
- branches (){}[] vital part of language;
- _ , $ have no special meaning can used variable names.
what # char? why special?
there nothing special #. it's 1 of many characters no valid unicode identifier start or identifier continue. better question might have been makes $ , _ special became valid identifier parts?
what might make special it's 1 of few printable ascii characters invalid identifier names not used punctuators anywhere else in ecmascript 1. there are
`, used delimiter template literals since es6@, proposed used decorator syntax#, proposed used private field syntax
Comments
Post a Comment