Created
September 20, 2018 16:12
-
-
Save Drag13/924b6434273ea770f83871125bce1777 to your computer and use it in GitHub Desktop.
This file contains 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
const originalPush = Array.prototype.push; | |
Array.prototype.push = function newPush() { | |
console.log('before push'); | |
originalPush.call(this, arguments[0]); | |
console.log('after push'); | |
} | |
let x = []; | |
x.push('a'); | |
console.log(x[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment