Ok JavaScripter, I bet there's a really simple answer to this: Why is the return value of `eval('{foo:42}')` the number `42`, and the object `{foo:42}`?
-
-
Yeah I found if I added `x = {...}` it worked. What threw me off first was that I initially tried `eval('{__proto__:{isAdmin: true}}')` but that’s basically just a more elaborate version of the one I ended up tweeting
-
Judging from what you tried to do, it was supposed to add a field to the prototype of global, which should be equivalent to changing Object.prototype What am I missing?
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.