Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Object.defineProperty(Array.prototype, 0, {
- get: function() {console.log("Got em"); window.someArray = this; return 0;},
- set: function() {console.log("Got em again")}
- });
- (function() {
- let test = [];
- test[0];
- })();
- (function() {
- let test = ["hello", "world"];
- test[0];
- })();
- Object.defineProperty(Array.prototype, 'push', {
- value: function(){
- // rest of the code as Array API give to push the array
- console.log("hello world ");
- }
- });
- var arr = [];
- arr.push("Hi Jarvis");
- Hello World
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement