let result;
const userProfile = {
username: 'Khojiakbar',
age: 26,
job: 'programmer',
city: 'Tashkent region',
}
// Object.keys()
result = Object.keys(userProfile);
// Object.values()
result = Object.values(userProfile);
// Object.entries()
result = Object.entries(userProfile) // returning nested array
// Object.fromEntries()
let fromEntries = Object.fromEntries(result)
console.log(result);
console.log(fromEntries);
// Object.freeze()
Object.freeze(userProfile);
// Add -
userProfile.weight = 80
// Modify -
userProfile.username = 'Bilol'
// Delete -
delete userProfile.city
// NO AMD
console.log(userProfile);
// Object.isFrozen()
result = Object.isFrozen(userProfile)
console.log(result);
// Object.seal()
result = Object.seal(userProfile);
// Add -
userProfile.weight = 80;
// Modify +
userProfile.age = 33;
// Delete -
delete userProfile.city;
// NO AD
console.log(userProfile);
// Object.isSealed()
result = Object.isSealed(userProfile)
console.log(result);
Top comments (0)