(no title)
FrontAid | 3 years ago
var name = true;
typeof name; // "string", not "boolean"
Luckily, this is not true within ES modules which you probably use most of the time anymway.FrontAid | 3 years ago
var name = true;
typeof name; // "string", not "boolean"
Luckily, this is not true within ES modules which you probably use most of the time anymway.
esprehn|3 years ago
Other properties have the same behavior, for example `status`.
Note: there's also LegacyUnforgeable which has similar behavior: https://webidl.spec.whatwg.org/#LegacyUnforgeable
Even if you're not using modules, using an IIFE avoids all this by making your variables local instead of having them define/update properties on the global.
efdee|3 years ago
orangecat|3 years ago
sanitycheck|3 years ago
Minor49er|3 years ago
simlevesque|3 years ago
I must have never used "name" as a name for a global variable or just for ones that were strings.