js-head

1.0.2 • Public • Published

js-head

Get the first element in iterable collection

A common way of getting the first element in a collection which implements Iterable protocol.

Installation

$ npm i js-head

Usage

import head from 'js-head';
 
head([1, 2, 3]); // 1
head(new Set([1, 2, 3])); // 1
head(Immutable.List([1, 2, 3])); // 1

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i js-head

    Weekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • roman01la