npm.io
1.0.16 • Published 9 years ago

has-own-properties

Licence
MIT
Version
1.0.16
Deps
0
Vulns
0
Weekly
0
Stars
1

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

JavaScript Style Guide