#push=>mypush构建代码
Array.prototype.myPush = function(){
var len = this.length;
for(var key in arguments){
this[len+(+key)] = arguments[key];
}
return this.length;
}
var arr = ["Tom","Jack"];
var result = arr.myPush("aaa","bbb","ccc");
console.log(result,arr)
#pop=>mypop构建代码
Array.prototype.myPop = function(){
var b = this.length;
var result = this[b-1];
this.length = b-1;
return result;
}
var a = [1,2,3,4]
console.log(a.myPop())
console.log(a);