From 56eadb7f93e75de00542bffe748cd5eddaf4866d Mon Sep 17 00:00:00 2001 From: Steve Kinney Date: Sat, 28 Sep 2024 10:08:59 -0600 Subject: [PATCH] Update person.js --- examples/yearbook/person.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/yearbook/person.js b/examples/yearbook/person.js index 6c7e00b..68e66eb 100644 --- a/examples/yearbook/person.js +++ b/examples/yearbook/person.js @@ -1,4 +1,14 @@ +/** + * A person in the yearbook. + * @class Person + * @param {number} id + * @param {string} firstName + * @param {string} lastName + * @param {string} dateOfBirth + */ export class Person { + static id = 0; + /** * A person in the yearbook. * @param {string} firstName @@ -6,6 +16,7 @@ export class Person { * @param {string} dateOfBirth */ constructor(firstName, lastName, dateOfBirth) { + this.id = ++Person.id; this.firstName = firstName; this.lastName = lastName; this.dateOfBirth = dateOfBirth;