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]