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

isEmpty

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

Checks whether the sequence has no elements.

Signature

Sequence.isEmpty = function() { /*...*/ }
Sequence.isEmpty = function isEmpty() {
  return !this.any();
}
NameType(s)Description
returnsboolean

True if the sequence is empty, false if it contains at least one element.

Examples

Lazy([]).isEmpty()        // => true
Lazy([1, 2, 3]).isEmpty() // => false