does-it-exist

1.0.0 • Public • Published

does-it-exist

Build Passing NPM version

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
 

Dependencies (1)

Dev Dependencies (9)

Package Sidebar

Install

npm i does-it-exist

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • columbennett