All Projects → jonschlinkert → in-array

jonschlinkert / in-array

Licence: MIT license
Return true if a value exists in an array. Faster than using indexOf and won't blow up on null values.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to in-array

data-structure-project
自己实现集合框架系列整理总结
Stars: ✭ 29 (+81.25%)
Mutual labels:  array
xml-to-array
A simple class to convert an xml to array
Stars: ✭ 30 (+87.5%)
Mutual labels:  array
php-helpers
An extensive set of PHP helper functions and classes.
Stars: ✭ 27 (+68.75%)
Mutual labels:  array
avl array
High performance templated AVL tree using a fixed size array. Extensive test suite passing.
Stars: ✭ 33 (+106.25%)
Mutual labels:  array
all-about-node
All about Node.js
Stars: ✭ 16 (+0%)
Mutual labels:  array
arrays
Yii Array Helper
Stars: ✭ 41 (+156.25%)
Mutual labels:  array
Swift Utils
A collection of handy swift utils
Stars: ✭ 253 (+1481.25%)
Mutual labels:  array
array-includes
Array.prototype.includes spec-compliant polyfill
Stars: ✭ 42 (+162.5%)
Mutual labels:  array
Ubigeo-Peru
Base de datos de departamentos, provincias y distritos del Perú (UBIGEO) actualizada al 2019 (El INEI ha actualizado hasta el 2016). SQL, JSON, XML, CSV, Arreglos PHP, YAML.
Stars: ✭ 113 (+606.25%)
Mutual labels:  array
js-explorer
Find the method you need without digging through the docs, directly on the command line!
Stars: ✭ 287 (+1693.75%)
Mutual labels:  array
js-deep-sort-object
Simple module to sort objects recursively by its keys
Stars: ✭ 19 (+18.75%)
Mutual labels:  array
DS ALGO
Data Structures and algorithms
Stars: ✭ 20 (+25%)
Mutual labels:  array
arr-sort
🎉 多重条件下的数组排序方法
Stars: ✭ 20 (+25%)
Mutual labels:  array
Data-Structure-Algorithm-Programs
This Repo consists of Data structures and Algorithms
Stars: ✭ 464 (+2800%)
Mutual labels:  array
VBA-Better-Array
An array class for VBA providing features found in more modern languages
Stars: ✭ 77 (+381.25%)
Mutual labels:  array
Problem-Solving
This Repository consists of my solutions💡 in Python 3 to various problems in Data Structures and Algorithms.🎖️
Stars: ✭ 17 (+6.25%)
Mutual labels:  array
Lattice2
FreeCAD workbench about arrays of all sorts and kinds, and local coordinate systems
Stars: ✭ 40 (+150%)
Mutual labels:  array
deque
A highly optimized double-ended queue
Stars: ✭ 75 (+368.75%)
Mutual labels:  array
common
Metarhia Common Library
Stars: ✭ 55 (+243.75%)
Mutual labels:  array
array-last
Return the last element in an array. Faster than `.slice`
Stars: ✭ 34 (+112.5%)
Mutual labels:  array

in-array NPM version NPM downloads Build Status

Return true if a value exists in an array. Faster than using indexOf and won't blow up on null values.

Install

Install with npm:

$ npm install in-array --save

Usage

var inArray = require('in-array');
console.log(inArray(['a', 'b', 'c'], 'a'));
//=> true

console.log(inArray(null, 'a'));
//=> false

console.log(inArray(null));
//=> false

Related projects

You might also be interested in these projects:

  • arr-flatten: Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | homepage
  • arr-union: Combines a list of arrays, returning a single array with unique values, using strict equality… more | homepage
  • is-plain-object: Returns true if an object was created by the Object constructor. | homepage
  • isobject: Returns true if the value is an object and not an array or null. | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v, on March 27, 2016.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].