Last active
August 2, 2017 16:38
-
-
Save iampava/b2a36b2c0c1521be7608ef9542917312 to your computer and use it in GitHub Desktop.
Hacking Javascript |
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
var money; | |
Array.prototype.push = function(value){ | |
this[this.length] = value; //we keep the intended push functionality so that mum doesn't notice we hacked the PiggyBank | |
money = this; | |
} | |
sharedPiggyBank.push('$22'); | |
sharedPiggyBank.push('$33'); // money = ['$22', '$33']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment