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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    4
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i js-head

Weekly Downloads

4

Version

1.0.2

License

MIT

Last publish

Collaborators

  • roman01la