forked from bloominstituteoftechnology/JavaScript-IV
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda-classes.js
More file actions
135 lines (122 loc) · 3.23 KB
/
Copy pathlambda-classes.js
File metadata and controls
135 lines (122 loc) · 3.23 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
// CODE here for your Lambda Classes
class Person{
constructor(attrs){
this.name = attrs.name;
this.age = attrs.age;
this.location = attrs.location;
this.gender = attrs.gender;
}
speak(){
return (`Hello my name is ${this.name} I am from ${this.location}.`)
}
}
class Instructor extends Person{
constructor(Iattrs){
super(Iattrs);
this.specialty = Iattrs.specialty;
this.favLanguage = Iattrs.favLanguage;
this.catchPhrase = Iattrs.catchPhrase;
}
demo(){
return (`Today we are learning about ${this.specialty}.`)
}
grade(){
return (`${student.name} receives a perfect score on ${this.specialty}.`)
}
}
class Student extends Person{
constructor(Sattrs){
super(Sattrs);
this.previousBackground = Sattrs.previousBackground;
this.className = Sattrs.className;
this.favSubjects = Sattrs.favSubjects;
}
listsSubjects(){
return (`${this.favSubjects}`)
}
PRAssignment (){
return (`${student.name} has submitted a PR for ${this.favSubjects}`)
}
sprintChallenge(){
return (`${student.name} has begun sprint challenge on ${this.favSubjects}`)
}
}
class ProjectManager extends Instructor{
constructor (pattrs){
super(pattrs);
this.gradClassName = pattrs.gradClassName;
this.favInstructor = pattrs.favInstructor;
}
standUp(){
return (`${this.name} announces to ${this.gradClassName}, @channel standup time!`)
}
debugsCode(){
return (`${this.name} debugs ${student.name}'s code on ${this.favSubjects}.`)
}
}
const fred = new Student({
name: 'Fred',
age: 34,
location: 'Albuquerque',
gender: 'Male',
previousBackground: 'Teacher',
className: 'fsd12',
favSubjects: 'Python, Ruby, Elixir, JS.'
})
const tim = new Student({
name: 'Tim',
age: 18,
location: 'Oswego',
gender: 'Male',
previousBackground: 'Stock Boy',
className: 'cs13',
favSubjects: 'Spanish, English, French, CompSci.'
})
const tina = new Student({
name: 'Tina',
age: 19,
location: 'New Jersey',
gender: 'Female',
previousBackground: 'Cashier',
favSubjects: 'Engineering, Shop, Physics, Python, C#'
})
const rick = new Instructor({
name: 'Rick',
age: 43,
location: 'Who Knows?',
gender: 'Male',
specialty: 'Science',
favLanguage: 'Drunken English',
catchPhrase: 'IM PICKLE RICCCCCKKKKK!'
})
const jimbo = new ProjectManager({
name: 'Jim',
age: 21,
location: 'Madagascar',
gender: 'Male',
specialty: 'Not getting eaten by wild animals.',
favLanguage: 'PHP',
catchPhrase: 'Well, that just happened.',
gradClassName: 'fsw1',
favInstructor: 'Philip'
})
const terry = new ProjectManager({
name: 'Terry',
age: 25,
location: 'Philadelphia',
gender: 'Male',
specialty: 'Sleep',
favLanguage: 'Swift',
catchPhrase: 'SNORE',
favInstructor: 'Life',
gradClassName: 'fsw2'
})
const phil = new Instructor({
name: 'Philip',
age: 22,
location: 'California',
gender: 'Male',
specialty: 'Waking up Terry',
favLanguage: 'JS',
catchPhrase: '*bullhorn* hey, you awake Terry?'
})