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

without

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

Creates a new sequence with all the elements of this sequence that are not also among the specified arguments.

Signature

Sequence.without = function(var_args) { /*...*/ }
Sequence.without = function without(var_args) {
  return new WithoutSequence(this, arraySlice.call(arguments, 0));
}
NameType(s)Description
var_args...*

The values, or array(s) of values, to be excluded from the resulting sequence.

returnsSequence

The new sequence.

Examples

Lazy([1, 2, 3, 4, 5]).without(2, 3)   // sequence: [1, 4, 5]
Lazy([1, 2, 3, 4, 5]).without([4, 5]) // sequence: [1, 2, 3]