property-exists
Return a boolean indicating whether the object has the specified property (as a direct property of that object)
Install
$ npm install --save property-exists
Usage
var propertyExists = ; var person = name: 'Ygritte' { return "You know nothing, Jon Snow"; }; ; // => true; // => false var anotherPerson = Object; ; // => false
API
propertyExists()
Return a boolean indicating whether the object has the specified property (as a direct property of that object)
Params
- Object
obj
- An object to test - String
key
- A property name to test
Return
- Boolean - Result
License
MIT © Philipp Alferov