Created
June 23, 2014 05:02
-
-
Save lackneets/bba14f1a70f0dd85c540 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MyArray() { | |
var parent = { // Remember the Origional-methods | |
push: this.push | |
} | |
this.push = function (element) { // Override | |
// Do my actions | |
return parent.push.apply(this, arguments); | |
} | |
} | |
// MyArray inherits from Array | |
MyArray.prototype = Object.create(Array.prototype); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment