js-take

1.0.0 • Public • Published

npm Build Status

js-take

A function to extract an array sequence of the first n items from another array, or all items if there are fewer than n. Similar to Clojure's take, but without laziness.

Installation

npm i -S js-take

Usage

import range from 'js-take';
 
take(2, [1, 2, 3, 4]]); // [1, 2]
take(3, [1, 2]); // [1, 2]

Readme

Keywords

Package Sidebar

Install

npm i js-take

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • roman01la