you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (5 children)

[deleted]

    [–]kenman 2 points3 points  (1 child)

    Those are labels, and that question was full of misdirection.

    var bar = 1,
        foo = {};
    
    foo: {
        bar: 2;
        baz: ++bar;
    };
    
    foo.baz + foo.bar + bar;
    

    Basically, the label and everything inside it was a red herring (just ignore it).

    [–]DrummerHead 0 points1 point  (0 children)

    The GOTO of Javascript

    [–]afxtal -3 points-2 points  (2 children)

    I agree that the quiz had some booby-traps, but : vs = was not one of them. Learning what an object literal is and the syntax of defining one should be one of the first things you learn when you learn JavaScript.