I have this bit of javascript code in the browser
console.log( eval('{a:23}'));
and it prints 23
I was expecting instead to see
[Object]
can somebody explain ?
thanks
In that context, { starts a block, not an object literal.
a: is then a label.
That leaves 23.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With