Skip to content

col1985/exists

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published