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

pop

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

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

Signature

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

The new array-like sequence.

Examples

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