Skip to content

LinusU/first-of-iterable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Returns the first item of an iterable

Resources

Stars

Watchers

Forks

Packages

No packages published