Skip to content

Instantly share code, notes, and snippets.

Last active Dec 10, 2020
What would you like to do?
class Teacher {
constructor(fullName) {
this.fullName = fullName;
class School {
constructor(address) {
this.address = address;
class Student {
constructor(firstName, lastName, teacher, school) {
this.firstName = firstName;
this.lastName = lastName;
this.teacher = teacher; = school;
//If need to expose a School to an external API or a Database. Another object (not school) will keep the mapping externalId<->school and so on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment