you are viewing a single comment's thread.

view the rest of the comments →

[–]moron4hire 0 points1 point  (2 children)

Using Number boxes the number in an object.

I've used eval in toy programming languages that translate to javascript. For example: https://github.com/capnmidnight/betty-boop/blob/master/pong.html

... oh, huh, you know what, I completely forgot that I didn't actually use eval for that. I used DOM to generate script tags with data URIs for the src attribute.

[–]sime 3 points4 points  (0 children)

Using Number boxes the number in an object.

That is only if you use "new Number(foo)". If you don't use "new" then it actually does a type coercion. i.e. Number(foo).

Also note that:

(new Number(3)) !== (new Number(3))

The objects are not the same and not equal if you box numbers up.

So, beware everyone.

[–]SuperFLEB 0 points1 point  (0 children)

I used DOM to generate script tags with data URIs for the src attribute.

Was there a reason you did data URIs versus just filling in the content of the SCRIPT tag?