@writetome51/array-starts-with-ends-with
v2.0.0
Published
Functions that check if array starts with certain items, or ends with certain items
Downloads
8
Maintainers
Readme
arrayStartsWith(values, array): boolean
Returns true if array
starts with values
.
arrayEndsWith(values, array): boolean
Returns true if array
ends with values
.
Examples
let arr = ['a','b','e','f','g','h','i'];
arrayStartsWith(['a','b','e'], arr); // true
let arr = ['a','b','e','f','g','h','i'];
arrayEndsWith(['h','i'], arr); // true
Installation
npm i @writetome51/array-starts-with-ends-with
Loading
import {arrayStartsWith, arrayEndsWith}
from '@writetome51/array-starts-with-ends-with';