https://github.com/writetome51/array-starts-with-ends-with
Functions that check if array starts with certain items, or ends with certain items
https://github.com/writetome51/array-starts-with-ends-with
array-manipulations javascript typescript
Last synced: 11 months ago
JSON representation
Functions that check if array starts with certain items, or ends with certain items
- Host: GitHub
- URL: https://github.com/writetome51/array-starts-with-ends-with
- Owner: writetome51
- License: mit
- Created: 2018-09-26T22:18:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-15T01:06:07.000Z (over 5 years ago)
- Last Synced: 2025-02-02T21:28:40.624Z (11 months ago)
- Topics: array-manipulations, javascript, typescript
- Language: TypeScript
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# arrayStartsWith(values, array): boolean
Returns true if `array` starts with `values`.
# arrayEndsWith(values, array): boolean
Returns true if `array` ends with `values`.
## Examples
```js
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
```js
import {arrayStartsWith, arrayEndsWith}
from '@writetome51/array-starts-with-ends-with';
```