JSPM

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

Return true if any of passed values exists in array. Using [in-array][].

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 npmjs.com The MIT License

Return true if any of passed values exists in array. Using in-array.

code climate standard code style travis build status coverage status dependency status

Install

npm i arr-includes --save

Usage

For more use-cases see the tests

const arrIncludes = require('arr-includes')

arrIncludes

Check any of values exists on arr. Also works as in-array.

Params

  • arr {Array}: array to check
  • values {Array|String}: array or anything that in-array supports.
  • returns {Boolean}: always boolean false or true, never throws

Example

var arrIncludes = require('arr-includes')

console.log(arrIncludes([1, 'bar', 3], 2)) // => false
console.log(arrIncludes([1, 'bar', 3], 3)) // => true

console.log(arrIncludes([1, 'bar', 3, true], false)) // => false
console.log(arrIncludes([1, 'bar', 3, true], true)) // => true

console.log(arrIncludes(['foo', 'bar'], 'baz')) // => false
console.log(arrIncludes(['foo', 'bar'], 'foo')) // => true

console.log(arrIncludes(['foo', 'bar', 'qux'], ['a', 'b', 'c'])) // => false
console.log(arrIncludes(['foo', 'bar', 'qux'], ['a', 'b', 'foo'])) // => true

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckoCore.tk keybase tunnckoCore tunnckoCore npm tunnckoCore twitter tunnckoCore github