-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathlambda-classes.js
More file actions
131 lines (119 loc) · 3.32 KB
/
lambda-classes.js
File metadata and controls
131 lines (119 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// CODE here for your Lambda Classes
class Person {
constructor(attribute) {
this.name = attribute.name;
this.age = attribute.age;
this.location = attribute.location;
}
speak() {
return `Hello my name is ${this.name}, I am from ${this.location}. `;
}
}
class Instructor extends Person {
constructor(attribute) {
super(attribute);
this.specialty = attribute.specialty;
this.favLanguage = attribute.favLanguage;
this.catchPhrase = attribute.catchPhrase;
}
demo(subject) {
return `Today we are learning about ${subject}.`;
}
grade(student, subject) {
return `${student.name} receives a perfect score on ${this.subject}!`;
}
}
class Student extends Person {
constructor(attribute) {
super(attribute);
this.previousBackground = attribute.previousBackground;
this.className = attribute.className;
this.favSubjects = attribute.favSubjects;
}
listsSubjects(favSubjects) {
return this.favSubjects;
}
PRAssignment(subject) {
return `${this.name} has submitted a PR Assignment for ${subject}.`;
}
sprintChallenge(subject) {
return `${this.name} has begun the sprint challenge on ${subject}!`;
}
}
class ProjectManager extends Instructor {
constructor(attribute) {
super(attribute);
this.gradClassName = attribute.gradClassName;
this.favInstructor = attribute.favIntructor;
}
standUp(channel) {
return `${this.name} announces to ${channel}, @channel standy times!`;
}
debugsCode(student, subject) {
return `${this.name} debugs ${student}'s code on ${subject}.`;
}
}
const student_one = new Student({
name: "Greg",
age: 30,
location: "Austin",
previousBackground: "Uber",
className: "Javascript II",
favSubjects: ["HTML", "Javascript", "CS"]
});
const student_two = new Student({
name: "Colin",
age: 28,
location: "Salt Lake City",
previousBackground: "Sales",
className: "Javascript II",
favSubjects: ["Javascript", "Redux"]
});
const student_three = new Student({
name: "Eric",
age: 22,
location: "San Antonio",
previousBackground: "Retail",
className: "Javascript II",
favSubjects: ["HTML", "CSS", "npm"]
});
const instructor_one = new Instructor({
name: "Brit Demming",
age: 31,
location: "Canada",
specialty: "Keepin' it real",
favLanguage: "Javascript, HTML, CSS",
catchPhrase: "You're gonna know all about my pets"
});
const instructor_two = new Instructor({
name: "Ryan Hamblin",
age: 32,
location: "Salt Lake City",
specialty: "Prototypical Inheritance",
favLanguage: "Javascript, React",
catchPhrase: "Put the keys in the car"
});
const projectManager_one = new ProjectManager({
name: "Don Whitely",
age: 40,
location: "Indianapolis",
specialty: "Troubleshooting",
favLanguage: "React, Python",
catchPhrase: "Hold em' or Fold em'",
gradClassName: "Web13",
favInstructor: "James Starks"
});
const projectManager_two = new ProjectManager({
name: "Joseph Hayden",
age: 30,
location: "Chicago",
specialty: "Keepin' it real",
favLanguage: "Javascript, Python",
catchPhrase: "Wubba Lubba Javascript",
gradClassName: "Web18",
favInstructor: "Brit Demming"
});
console.log(student_three.PRAssignment("CSS"));
console.log(projectManager_one.standUp("Web24"));
console.log(projectManager_two.debugsCode("Greg", "CSS"));
console.log(instructor_two.demo("callback functions"));