>> {} + [] 0
So EmptyObject + EmptyArray evaluates to 0. (Disclaimer: I don't fully understand why this is.) Okay, now I want to assign this 0 to a variable! Seems pretty easy:
>> var a = {} + []; undefined >> a "[object Object]"
Well, maybe not so easy. Googles a bit... Aha! {} in this context is actually a code block, not an empty object. So lemme make it look more like a code block:
>> var a = { } + []; undefined >> a "[object Object]"
...dang. Note to self: JavaScript ignores whitespace.
Is there any way I can assign {} + [] (or similar) to a variable, but still have that {} + [] evaluate to 0?