1const object1 = new Object();
2object1.property1 = 42;
3
4console.log(object1.hasOwnProperty('property1'));
5// expected output: true
1var person = {'first_name': 'bill','age':20};
2
3if ( person.hasOwnProperty('first_name') ) {
4 //person has a first_name property
5}
6