Are Unicode characters valid in variable names?

I know you cannot do

var foo = {};
foo.✈ = "NOT VALID";

but you can do

var foo = {};
foo["✈"] = "VALID";

foo["✈"]definitely makes a property fooand can definitely be used as a variable, but from a technical point of view, is it a "variable"?

+4
source share
1 answer

no. ✈ in your array is not a variable. that's for sure ✈

you can make it variable if you care.

var ✈ = "something";

looks great

0
source

Source: https://habr.com/ru/post/1542406/


All Articles