Code: Select all
const user = {
password: "prateeksharma",
city: "shamli"
}
const chai = Object.getOwnPropertyDescriptor(user, 'password')
console.log(chai)
Object.defineProperty(user, 'password', {
writable: false,
enumerable: false,
configurable: false
});
const tea = user.password = "pandit@123"
console.log(tea)