I have created a simple object below,
let user = {
birthYear: 1991,
calcAge: function () {
return 2021 - this.birthYear;
},
currentAge: calcAge(), //`-------------------- x`
};
console.log(user.calcAge());
getting an error at x with reference error. What can be the error?