|
|
|
|
|
by Zarel
2244 days ago
|
|
How did you explicitly make it into an object literal? ({}) + []
-> "[object Object]"
will correctly make it "[object Object]"Did you try to do this? {a: 1} + []
-> 0
That's interpreted as the statement 1 labeled a, not as an object. This makes it obvious it's not an object: {a: 1, b: 2} + []
-> Uncaught SyntaxError: Unexpected token ':'
JavaScript supports labels so you can continue/break multiple levels at once: {
a: while (true)
while (true)
break a;
}
|
|