Returns the rest of the elements in an array. Pass an index to return the values of the array from that index onward

返回数组中的元素的其余部分。通过索引返回数组中的值,从该指数开始. 别名tail

_.rest([5, 4, 3, 2, 1]);
=> [4, 3, 2, 1]

源码:

 _.rest = _.tail = function(array, index, guard) {
    return slice.call(array, (index == null) || guard ? 1 : index);
  };

  

 

posted on 2012-04-15 22:36  himanhimao  阅读(225)  评论(0编辑  收藏  举报