当前位置: 首页 > 文档资料 > Lazy.js 英文文档 >

shift

优质
小牛编辑
138浏览
2023-12-01

Returns a new sequence with the same elements as this one, minus the first element.

Signature

ArrayLikeSequence.shift = function() { /*...*/ }
ArrayLikeSequence.shift = function shift() {
  return this.drop();
}
NameType(s)Description
returnsArrayLikeSequence

The new array-like sequence.

Examples

Lazy([1, 2, 3]).shift() // sequence: [2, 3]
Lazy([]).shift()        // sequence: []