Update person.js
This commit is contained in:
@@ -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 {
|
export class Person {
|
||||||
|
static id = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A person in the yearbook.
|
* A person in the yearbook.
|
||||||
* @param {string} firstName
|
* @param {string} firstName
|
||||||
@@ -6,6 +16,7 @@ export class Person {
|
|||||||
* @param {string} dateOfBirth
|
* @param {string} dateOfBirth
|
||||||
*/
|
*/
|
||||||
constructor(firstName, lastName, dateOfBirth) {
|
constructor(firstName, lastName, dateOfBirth) {
|
||||||
|
this.id = ++Person.id;
|
||||||
this.firstName = firstName;
|
this.firstName = firstName;
|
||||||
this.lastName = lastName;
|
this.lastName = lastName;
|
||||||
this.dateOfBirth = dateOfBirth;
|
this.dateOfBirth = dateOfBirth;
|
||||||
|
|||||||
Reference in New Issue
Block a user