How about the idea would be the subtraction of two dates in javascript
to then add it within the function. I show them what I am doing and so they can help me.
var newYear = new Array(12, 5, 2018);
var jhon = {
name: "Jhon",
lastName: "Smith",
job: "Teacher",
yearOfBirth: new Array(11, 11, 1996),
calculateAge: function(){
this.age = this.newYear - this.yearOfBirth;
}
};
jhon.calculateAge();
console.log(jhon);
As I said before, the idea is to be able to calculate the subtraction of dates and then be able to insert it within the properties of the object.