|
|
|
|
|
by Cushman
5250 days ago
|
|
This appears to be a peculiarity of the REPL implementations, not a difference between V8 and JSC. d8 (and the Chrome console) behaves the same way as jsc, while you can make d8 and jsc behave the same as the node REPL by wrapping each statement in parentheses: d8> ([] + [])
d8> ([] + {})
[object Object]
d8> ({} + [])
[object Object]
d8> ({} + {})
[object Object][object Object]
So I believe this is merely erroneous behavior of the console, not a weirdness of JavaScript itself. |
|
I didn't mention any of this in the talk (it would've killed the flow ;). Instead, I glossed over it and interpreted the syntax as any sane programmer would.