3 ms·
The John Resig post linked by TFA indicates that this was originally dealt with by locking the constructor altogether: function Array(){ alert("hello,
by gavinpc 9y ago
The John Resig post linked by TFA indicates that this was originally dealt with by locking the constructor altogether:
function Array(){
alert("hello, I found something of yours!");
}
// ERROR: redeclaration of const Array
But it appears that the restriction now applies only to literals, as I can do this in at least Chrome and Firefox:
function Array() {console.log("hope")}
undefined
var x = new Array(3);
hope
undefined
https://johnresig.com/blog/re-securing-json/ https://johnresig.com/blog/re-securing-json/