【发布时间】:2015-01-04 05:34:26
【问题描述】:
我需要执行类似于以下用 C# 编写的操作:
int[] items = { 1, 2, 3, 4, 5, 6, 7 };
var a = items.Skip(2).Take(3);
返回 3、4 和 5
同样,我需要跳过对象列表
中的记录$scope.myObject = [ { Editable: true, Name: "Daniel Test", Site: "SE100"},
{ Editable: true, Name: "Test new", Site: "SE100"},
{ Editable: false, Name: "Test", Site: "SE100"} ]
我需要跳过第一条记录并取回剩余的记录,即第1-n条记录
如何使用 lodash/underscore 来做到这一点?
【问题讨论】:
标签: javascript underscore.js lodash