@leonetti/array-first-ts
v0.0.2
Published
get first elements of array using typescript
Downloads
21
Readme
Get first n elements using TypeScript
Get first n elements using TypeScript.
Install
npm install @leonetti/array-first-ts
Usage
import {arrayFirst} from '@leonetti/array-first-ts';
arrayFirst(['a', 'b', 'c', 'd', 'e', 'f']);
//=> 'a'
arrayFirst(['a', 'b', 'c', 'd', 'e', 'f'], 4);
//=> ['a', 'b', 'c','d']