-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathlambda-classes.js
More file actions
170 lines (145 loc) · 3.84 KB
/
lambda-classes.js
File metadata and controls
170 lines (145 loc) · 3.84 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// CODE here for your Lambda Classes
class Person{
constructor(atts){
this.name = atts.name;
this.age = atts.name;
this.location = atts.location;
this.subject = atts.subject;
}
speak(){
return `Hello my name is ${this.name}, I am from the ${this.location}!`
}
}
class Student extends Person{
constructor(atts){
super(atts);
this.previousBackground = atts.previousBackground;
this.className = atts.className;
this.favSubjects = atts.favSubjects;
}
listsSubjects(){
return `These are my favorite subjects - ${this.favSubjects}!`
}
prAssignment(){
return `${this.name} has submitted a PR for ${this.subject}!`
}
sprintChallenge(){
return `${this.name} has begun sprint challenge on ${this.subject}!`
}
}
class Instructor extends Person{
constructor(atts){
super(atts);
this.specialty = atts.specialty;
this.favLanguage = atts.favLanguage;
this.catchPhrase = atts.catchPhrase;
}
demo(){
return `Today we are learning about ${this.subject}!`
}
grade(){
return `${Student.name} receives a perfect score on ${this.subject}!`
}
}
class ProjectManager extends Instructor{
constructor(atts){
super(atts);
this.gradClassName = atts.gradClassName;
this.favInstructor = atts.favInstructor;
this.channel = atts.channel;
}
standUp(){
return `${this.name} announces to ${this.channel}, @channel standy times!`
}
debugsCode(){
return `${this.name} debugs ${Student.name}'s code on ${this.subject}!`
}
}
const james = new Person({
name: "James",
age: 33,
location: "USA",
subject: "biology"
})
console.log(james.speak());
const emily = new Person({
name: "Emily",
age: 33,
location: "Austrailia",
subject: "biology"
})
// console.log(emily.speak());
const brit = new Instructor({
name: "Brit",
age: 25,
location: "USA",
subject: "Classes",
specialty: "Web Development",
favLanguage: "JS",
catchPhrase: "AYEEE IM CANADIAN!"
})
console.log(brit.demo());
console.log(brit.grade());
const jordan = new Instructor({
name: "Jordan",
age: 25,
location: "USA",
subject: "Classes",
specialty: "Web Development",
favLanguage: "JS",
catchPhrase: "AYEEE IM CANADIAN!"
})
// console.log(jordan.demo());
// console.log(jordan.grade());
const josh = new Student({
name: "Josh",
age: 22,
location: "USA",
subject: "Classes",
previousBackground: "College Student",
className: "WEB25",
favSubjects: "JavaScript, HTML, CSS"
})
console.log(josh.listsSubjects());
console.log(josh.prAssignment());
console.log(josh.sprintChallenge());
const brendan = new Student({
name: "Brendan",
age: 22,
location: "USA",
subject: "Classes",
previousBackground: "College Student",
className: "WEB25",
favSubjects: "JavaScript, HTML, CSS"
})
// console.log(brendan.listsSubjects())
// console.log(brendan.prAssignment())
// console.log(brendan.sprintChallenge())
const roenz = new ProjectManager({
name: "Roenz",
age: 26,
location: "USA",
subject: "Classes",
specialty: "Web Development",
favLanguage: "JS",
catchPhrase: "MACHINE LEARNING!",
gradClassName: "WEB20??",
favInstructor: "BRITTTTTT",
channel: "the slack channel WEB_25_ROENZ"
})
console.log(roenz.standUp());
console.log(roenz.debugsCode());
const ryan = new ProjectManager({
name: "Ryan",
age: 26,
location: "USA",
subject: "Classes",
specialty: "Web Development",
favLanguage: "JS",
catchPhrase: "MACHINE LEARNING!",
gradClassName: "WEB20??",
favInstructor: "BRITTTTTT",
channel: "the slack channel WEB_25_RYAN"
})
// console.log(ryan.standUp());
// console.log(ryan.debugsCode());