Checks if an object has a specific key.
The object to check.
The key to check for.
Returns true if the object has the key, false otherwise.
const myObj = { name: 'John', age: 30 };objHas(myObj, 'name');//=> trueobjHas(myObj, 'email');//=> false Copy
const myObj = { name: 'John', age: 30 };objHas(myObj, 'name');//=> trueobjHas(myObj, 'email');//=> false
Generated using TypeDoc
Checks if an object has a specific key.