has-own-properties
v1.0.16
Published
Extends Object with .hasOwnProperties, which takes an array instead of just a single key.
Downloads
8
Readme
Extends Object with .hasOwnProperties – an array version of .hasOwnProperty.
Returns boolean true
if every specified property is found.
Usage:
const dog = {tail: 1, fur: 1}
console.log(
dog.hasOwnProperties(['tail', 'fur'])
)
// true
Alternative(s) to using this library:
const dog = {tail: 1, fur: 1}
console.log(
['tail', 'fur'].every(ele=>dog.hasOwnProperty(ele))
)
// true