Code itself:
var person = {
Name: "nikita",
Age: 18,
GENDER: "MALE"
}
Object.DefineProperty (Person, 'Age', {
Get: Function () {
Return this.age;
},
SET: FUNCTION (NAGE) {
RETURN THIS.AGE = NAGE;
}
});
Console.log (Person.age)
person.age = 19;
Console.log (Person.age)
Answer 1, Authority 100%
@grommash the hellscream properties functions should not operate the property itself otherwise the infinite Recursion Object.DefineProperty (Person, age '
, {change the name here or use only Value instead of SET and GET, which is a special meaning Does not, it is already important or in the SET and GET themselves do not use this.age