Update some of the exercises

This commit is contained in:
Steve Kinney
2024-09-16 13:13:38 -06:00
parent a028678660
commit 1747f705a6
15 changed files with 1617 additions and 597 deletions

View File

@@ -0,0 +1,17 @@
import { v4 as id } from 'uuid';
export class Person {
constructor(firstName, lastName) {
if (!firstName || !lastName) {
throw new Error('First name and last name are required');
}
this.id = 'person-' + id();
this.firstName = firstName;
this.lastName = lastName;
}
get fullName() {
return `${this.firstName} ${this.lastName}`;
}
}