// bad
console.log(object.hasOwnProperty(key));
// good
console.log(Object.prototype.hasOwnProperty.call(object, key));
// best
const has = Object.prototype.hasOwnProperty; // cache the lookup once, in module scope.
console.log(has.call(object, key));
const car={type:SUV,color:'Black'}
console.log('color'in car);// true
console.log('maxSpeed'in car)// false