From e53efe9d9769e6971f7f10331fc6de9a0432bed7 Mon Sep 17 00:00:00 2001 From: Jessica Novak Date: Thu, 17 Oct 2019 15:59:50 -0700 Subject: [PATCH] initial commit --- assignments/lambda-classes.js | 135 ++++++++++++++++++++++++++++++ assignments/prototype-refactor.js | 99 ++++++++++++++++++++-- 2 files changed, 226 insertions(+), 8 deletions(-) diff --git a/assignments/lambda-classes.js b/assignments/lambda-classes.js index 71acfca0e..f3dc0690e 100644 --- a/assignments/lambda-classes.js +++ b/assignments/lambda-classes.js @@ -1 +1,136 @@ // CODE here for your Lambda Classes +class Person { + constructor(personAttr) { + this.name = personAttr.name; + this.age = personAttr.age; + this.location = personAttr.location; + this.gender = personAttr.gender; + }; + + speak() { + return `Hello my name is ${this.name}, I am from ${this.location}.`; + }; +}; + +class Instructor extends Person { + constructor(instructorAttr) { + super(instructorAttr); + this.specialty = instructorAttr.specialty; + this.faveLanguage = instructorAttr.faveLanguage; + this.catchPhrase = instructorAttr.catchPhrase; + }; + + demo(subject) { + return `Today we are learning about ${subject}.`; + }; + + grade(student, subject) { + return `${student.name} receives a perfect score on ${subject}.`; + }; +}; + +class Student extends Person { + constructor(studentAttr) { + super(studentAttr); + this.previousBackground = studentAttr.previousBackground; + this.className = studentAttr.className; + this.favSubjects = studentAttr.favSubjects; + }; + + listSubjects() { + let i = 0; + while (i