Answers for "js find if there is item that has property x"

17

how to check if object has key javascript

myObj.hasOwnProperty('key') // it checks object for particular key and not on prototype
Posted by: Guest on March-28-2020
6

js check if object has property

const object1 = new Object();
object1.property1 = 42;

console.log(object1.hasOwnProperty('property1'));
// expected output: true
Posted by: Guest on April-13-2020

Code answers related to "js find if there is item that has property x"

Code answers related to "Javascript"

Browse Popular Code Answers by Language