- Delete Array.prototype.push and push method will not work for all arrays.
- As you can call function before and define it after in the program it'll work, but defining prototype methods after and calling it before will throw 'not a function' error
function foo(a){
this.a = a;
}
// define after call before - function (success)
console.log(baz());
function baz () {
return 'baz returned'
}
foo.obno = function () {
console.log('obno');
}
console.log(foo.prototype.ojo(),foo.prototype);
// define after call before - prototype method (error)
var bar = new foo(7);
console.log('bar',bar);
bar.ojo();
foo.prototype.ojo = function (){
console.log('ojo',this.a);
return 'a ojo returned';
}