Skip to content Skip to sidebar Skip to footer

Why Can't I Change The Type Of `name` In Firefox Web Console?

In Firefox web console, why can I change the type of name2 var name2=12 undefined typeof name2 'number' name2='hello' 'hello' typeof name2 'string' and not for name typeof name

Solution 1:

It's explicitly being cast to a string by JavaScript, since it's a readonly property of the global object (thanks Pointy).


Post a Comment for "Why Can't I Change The Type Of `name` In Firefox Web Console?"