starry.find

4.0.0 • Public • Published

Member of the starry suite—modular functions for iterable objects.

npm node

Status

Applies to the whole suite.

Build Status Coverage Status

Usage

function find<T = any>(
  iterable: Iterable<T>,
  predicate: (item: T) => boolean
  )

Returns the first element in the iterable that satisfies the predicate.

Returns undefined if no element satisfies the predicate.

Parameters:

  • iterable: Iterable<T>
  • predicate: (T) => boolean

Returns: T | undefined

Package Sidebar

Install

npm i starry.find

Weekly Downloads

0

Version

4.0.0

License

MIT

Unpacked Size

3.91 kB

Total Files

9

Last publish

Collaborators

  • seangenabe