const user = {
name: "Sicrano",
age: 14
}
user.hasOwnProperty('name'); // Retorna true
user.hasOwnProperty('age'); // Retorna true
user.hasOwnProperty('gender'); // Retorna false
user.hasOwnProperty('address'); // Retorna false
const userOne = {
name: 'Chris Bongers',
email: 'info@daily-dev-tips.com',
};
const userTwo = {
name: 'John Do',
};
console.log(userOne.hasOwnProperty('email'));
// Returns: true
console.log(userTwo.hasOwnProperty('email'));
// Returns: false