Code Monkey

于工开始移山

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

[].forEach(function(value,index,array){},this);
[].some(function(value,index,array){return true;/* stop */},this);
[].every(function(value,index,array){return false;/* stop */},this);
[].concat();
[].join();
[].pop();
[].push();
[].shift();
[].unshift();
[].map(function(value,index,array){return value;},this);
[].filter(function(value,index,array){return true;},this);
[].sort(function(a,b){return a-b;});
[].reduce(function(previousValue, currentValue, index, array){return previousValue+currentValue;/* example:sum */}, initialValue);
[].reduceRight(function(previousValue, currentValue, index, array){return previousValue+currentValue;/* example:sum */}, initialValue);
[].slice(start,end); /* Array.prototype.slice.call({ 0: 'a', 1: 'b', length: 2 }) => ['a', 'b'] */
[].splice(index,howmany,element1,.....,elementX);
[].indexOf(obj,startIndex); /* or: key in array */
[].reverse();

posted on 2014-10-14 12:25  MSchina  阅读(129)  评论(0)    收藏  举报