1.0.0 • Published 7 years ago

first-of-iterable v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

First of Iterable

Returns the first item of an iterable.

Installation

npm install --save first-of-iterable

Usage

const firstOfIterable = require('first-of-iterable')

console.log(firstOfIterable([]))
//=> undefined

console.log(firstOfIterable([1, 2, 3]))
//=> 1

API

firstOfIterable(iterable)

Return the first value of the iterable, or undefined if the iterable is empty.