JSPM

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

Checks that a value exists in an array and returns a boolean result. Generally faster than `indexOf` across JS engines.

Package Exports

  • inarray

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 (inarray) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

inarray

Checks that a value exists in an array and returns a boolean result. Generally faster than indexOf across JS engines.

Build Status Code Climate js-standard-style

npm install inarray --save

You can also use Duo, Bower or download the files manually.

npm stats

npm NPM downloads David

API Example

Basic
var inarray = require('inarray')

inarray(['a', 'b', 'c'], 'b')
//=> true

inarray(['a', 'b', 'c'], 'z')
//=> false
Pointfree Style
var inarray = require('inarray')
var list = ['a', 'b', 'c']

['a', 'c'].every(inarray(list))
//=> true

API

inarray(list, item)

arguments
  • list (array) The list to search.
  • item (*) The item/value to search for.
returns
  • (boolean) Whether given value exists in array.

Alternatives

Contributing

SEE: contributing.md

Licenses

GitHub license