I thought the syntax:
var a, b, c = {};
would mean that the three variables are separate, not references to the same {}.
Is this because {} is an object and this is the standard behavior?
So if I do:
var a, b, c = 0;
the three would indeed be separate and not references?
Thanks,
Wesley
They shouldn’t be the same, no. Only
cwill be assigned the value.aandbwould just be declared, but not initialized to anything (they’d be undefined).cwould, as the only one of them, be initialized to{}Perhaps it’s clearer when written on several lines: