@arr/includes
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@arr/includes

A tiny, faster alternative to native Array.prototype.includes

Install

$ npm install --save @arr/includes

Usage

import includes from '@arr/includes';

const foo = ['a', 'b', 'c', 'd'];

includes(foo, 'c');
//=> true
includes(foo, 'g');
//=> false
includes(foo, 'b', 2);
//=> false

API

includes(arr, item[, fromIndex])

arr

Type: Array
The array to iterate upon.

item

Type: Mixed
The element to search for.

fromIndex

Type: Integer
Default: 0
The position in the arr at which to begin searching.

License

MIT © Luke Edwards

Package Sidebar

Install

npm i @arr/includes

Weekly Downloads

17

Version

1.0.1

License

MIT

Unpacked Size

1.66 kB

Total Files

5

Last publish

Collaborators

  • lukeed