none
优质
小牛编辑
132浏览
2023-12-01
Checks whether NO elements in this sequence satisfy the given predicate (the opposite of Sequence#all, basically).
Signature
Sequence.none = function(predicate) { /*...*/ }
Sequence.none = function none(predicate) { return !this.any(predicate); }
Name | Type(s) | Description |
---|---|---|
predicate | Function? | A function to call on (potentially) every element in this sequence. |
returns | boolean | True if |
Examples
var numbers = [1, 2, 3, 4, 5]; Lazy(numbers).none() // => false Lazy(numbers).none(isEven) // => false Lazy(numbers).none(isNegative) // => true Lazy([]).none(isEven) // => true Lazy([]).none(isNegative) // => true Lazy([]).none() // => true