some(callback, thisp?)

Returns whether any entry in this collection passes a given test.

The given callback receives the value for each entry, the key or index, and the collection itself. some stops visiting entries upon reaching an entry for which the guard returns a truthy value, and returns true. Otherwise it will return false.

On collections

Usage

  • some(callback)
  • some(callback, thisp)

Example

var list = new List([2, 4, 6, 8]);
list.some(function (value) { return value % 2 === 0; });
list.some(function (value) { return value % 3 === 0 });
list.some(function (value) { return value === 10 });

Related