We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

Values, Variables, and Literals

I think the definition of "Object Literals" got removed erroneously. The anchor tag for it does not work now.

Now "Boolean Literals" exists at two places. This happened after the edit on 18-Jun-2012.

Can it be corrected?




I guess that the concept about what the var keyword does is quite wrong. There say that var "declares" a variable, and conceptually this keyword just binds a variable to the current scope. var is designed for scope bounding, not for declaring variables. Indeed, all variables in JavaScript are implicit and they're placed in the global scope by default, that's because it's so important to use var to bound a variable to a scope (even if we want to bound a variable to the global scope).

Could it be reviewed?




Yes, but isn't it already explained there ?
Both explanations seem the same to me.
teoli 05 October 2010


About the var keyword: I noticed, that both

 var b = a, a = "foo";


 var a = "foo", b = a;

produce an b == "foo". Any ideas, which one is canonical, or are both correct?


Document Tags and Contributors

Contributors to this page: Manuel Strehl, teoli, matias.mi
Last updated by: Manuel Strehl,