I want to apply prototype inheritance so my code should console logging 18 instead it is giving NaN
'use strict';
const Person= function(firstName,birthYear){
this.name=firstName;
this.year=birthYear;
}
const mahir=new Person("mahir",2003);
console.log(mahir);
// to check if mahir is instance of person
console.log(mahir instanceof Person)
// prototype inheritance
Person.prototype.calcAge=()=>{
console.log (2020-this.year);
}
mahir.calcAge();