0.1.3 • Published 10 years ago
inarray v0.1.3
inarray
Curried predicate which checks that a value exists in an array. Generally faster than
indexOfacross JS engines.
npm install inarray --saveYou can also use Duo, Bower or download the files manually.
npm stats
API Example
Basic
var inarray = require('inarray')
inarray(['a', 'b', 'c'], 'b')
//=> true
inarray(['a', 'b', 'c'], 'z')
//=> falsePointfree Style
var inarray = require('inarray')
var include = inarray(['a', 'b', 'c'])
['a', 'c'].every(include)
//=> trueAPI
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