From 8651ede879abc02dcc9aa00bd56dde9047faf26d Mon Sep 17 00:00:00 2001 From: didier amyot Date: Fri, 15 Dec 2023 20:04:32 -0500 Subject: [PATCH] added extra function --- modules-examples/hockey.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules-examples/hockey.js b/modules-examples/hockey.js index da4ffd5..41a4df4 100644 --- a/modules-examples/hockey.js +++ b/modules-examples/hockey.js @@ -130,6 +130,13 @@ export class HockeyPlayerStatistics { 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