JavaScript Object.create() hasOwnProperty
const obj = Object.create(null);
obj.propA = 'Value';
obj.propB = false;
console.log('propA:', obj.hasOwnProperty('propA')); // Uncaught TypeError: obj.hasOwnProperty is not a function
console.log('propC:', obj.hasOwnProperty('propC')); // Uncaught TypeError: obj.hasOwnProperty is not a function
no comments