Skip to content

Instantly share code, notes, and snippets.

@zpao
Created June 7, 2010 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zpao/429236 to your computer and use it in GitHub Desktop.
Save zpao/429236 to your computer and use it in GitHub Desktop.
Array.prototype.oldPush = Array.prototype.push;
Array.prototype.push = function(val) {
if (this.length > 3)
alert("wtfbbq - " + this);
this.oldPush(val);
};
var foo = [];
var bar = [1,2,3,4,5];
for (var i = 0; i < bar.length; i++) {
foo.push(bar[i]);
}
foo = foo.join('');
alert(foo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment