1const object1 = new Object();
2object1.property1 = 42;
3
4console.log(object1.hasOwnProperty('property1'));
5// expected output: true
1const hero = {
2 name: 'Batman'
3};
4
5hero.hasOwnProperty('name'); // => true
6hero.hasOwnProperty('realName'); // => false