first-of-iterable
v1.0.0
Published
Returns the first item of an iterable.
Downloads
3
Readme
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.