オブジェクトが指定されたプロパティを自身のプロパティとして持っているかどうか確認するには?
こちら、ご参考下さい!
index.js
//構文
obj.hasOwnProperty(prop)
//example
const object1 = {};
object1.property1 = 42;
console.log(object1.hasOwnProperty('property1')); // Expected output: true
console.log(object1.hasOwnProperty('toString')); // Expected output: false
console.log(object1.hasOwnProperty('hasOwnProperty')); // Expected output: false