I want to modify a method based off a method in the same object.
const date = new Date();
const year = date.getYear();
personData = {
birthdayYear: 2000,
age: year - personData.birthdayYear,
}
console.log(personData.age); // should return 22
How could I make this work?