array-includes
An ES7/ES2016 spec-compliant Array.prototype.includes shim/polyfill/replacement that works as far down as ES3.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the proposed spec.
Because Array.prototype.includes depends on a receiver (the this value), the main export takes the array to operate on as the first argument.
Getting started
npm install --save array-includesUsage
Basic usage: includes(array, value[, fromIndex=0])
var includes = require('array-includes');
var assert = require('assert');
var arr = [ 'one', 'two' ];
includes(arr, 'one'); // true
includes(arr, 'three'); // false
includes(arr, 'one', 1); // falseExample
Tests
Simply clone the repo, npm install, and run npm test
Last updated
Was this helpful?
