Your Search Results

    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?

    Thanks,

    GBh

    ====

    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?

    Thanks,

    Matías

    ====

    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";

    and

     var a = "foo", b = a;

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

    Manuel

    Document Tags and Contributors

    Contributors to this page: Manuel Strehl, Matías Mirabelli, teoli
    Last updated by: Manuel Strehl,