3 ms·
Try running this: Object.prototype.d = 4; Now you'll get: 1 2 3 4
by shawnz 12y ago
Try running this:
Object.prototype.d = 4;
Now you'll get:
1
2
3
4
- deleted 12y ago[deleted]
- jvickers 12y agoIf I were to run the code Object.prototype.d = 4; I'd be asking for trouble.
- shawnz 12y agoI agree, but lots of JS developers (mistakenly) think there is nothing wrong with this: Object.prototype.myDumbShim = function () { ... }; Chances are good that your code will be running in the same scope as one of these people's code eventually.