does-it-exist
v1.0.0
Published
checks if value exists in array or string returning boolean
Downloads
1
Maintainers
Readme
does-it-exist
Module to check if datatype contains param passed!
###Install
npm i does-it-exist --save
###Example
var exists = require('does-it-exist');
//sample datatypes
var array = ['hello', 'World'],
string = 'exists',
object = {name: 'your name'};
// check array has element
exists(array, 'World'); // true
exists(array, 'earth'); // false
// check object has property
exists(object, 'name'); // true
exists(object, 'mars'); // false
// check string has letter
exists(string, 'x'); // true
exists(string, 'w'); // false