模拟数组 push() 方法

var array =[];
Array.prototype.push = function (){
for (var i=0; i< arguments.length; i++){
this[this.length]= arguments[i];

}

return this.length;
}

posted @ 2019-08-13 20:46  呼吸之间  阅读(314)  评论(0编辑  收藏  举报