博客 / 列表

我們不動 - 前端筆試題總結

如何實現下列代碼:[1,2,3,4,5].duplicator(); // [1,2,3,4,5,1,2,3,4,5] 將此方法添加至 Array.prototype 實現,代碼如下: Array.prototype.duplicator = function(){   var l = this.length,i;   for(i=0;il;i++){    this.push(t

筆試 , 前端