Discussion: Offbeat Identifierz
Execute the code to understand the output and gain insights into using Unicode characters as identifiers in JavaScript.
Verifying the output
Now, it’s time to execute the code and observe the output.
Press + to interact
let シ = "\u2663";console.log(シ);
Unicode characters as identifiers
You might be surprised that シ
(which is a Japanese character called “shi”) is a valid identifier in JavaScript, and that \u2663
converts to a single character. But, in JavaScript, we can use a wide range of Unicode characters as identifiers. Surprisingly, not many developers know about this cool feature.
And that’s not all! We can also make use of ...