inarray

0.1.3 • Public • Published

inarray

Curried predicate which checks that a value exists in an array. 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 include = inarray(['a', 'b', 'c'])
 
['a', 'c'].every(include)
//=> 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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.3
    37
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.3
    37
  • 0.1.2
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i inarray

Weekly Downloads

29

Version

0.1.3

License

MIT

Last publish

Collaborators

  • wilmoore