JSPM

@arr/includes

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21
  • Score
    100M100P100Q48058F
  • License MIT

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

Package Exports

  • @arr/includes

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@arr/includes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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