1 Commits
Author SHA1 Message Date
didier amyot 8651ede879 added extra function 2023-12-15 20:04:32 -05:00
+7
View File
@@ -130,6 +130,13 @@ export class HockeyPlayerStatistics {
this.dateOfBirth = dateOfBirth; this.dateOfBirth = dateOfBirth;
} }
/**
* Returns the current age of the player in years.
*/
currentAge(){
return new HockeyPlayer(this.firstName, this.lastName, this.dateOfBirth).currentAge();
}
/** /**
* Set the total number the player has played * Set the total number the player has played