function person(name,age) {
this.name = name;
this.age = age;
let birthday = function() {
return new Date().getFullYear() - this.age;
}
this.data = function() {
return this.name + " "+this.age + ' birthday: ' + birthday();
}
}
const l = new person('JOhn', 24); console.log(l.data());// NaN `
Why the value of this.age is NaN and what I should do?