getter and setter in javascript
const person = {
name: "abc",
get Name() {
return this.name;
},
set Name(v) {
this.name = v;
}
};
console.log(person.Name);
person.Name = 'John Doe';
console.log(person.Name);