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
81 lines (73 loc) · 2.05 KB
/
Copy pathlambda-classes.js
File metadata and controls
81 lines (73 loc) · 2.05 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
// CODE here for your Lambda Classes
class Person {
constructor(info) {
this.name= info.name;
this.age= info.age;
this.location= info.location;
this.gender= info.gender;
}
speak(){
console.log(`Hello my name is ${this.name}, I am from ${this.location}.`);
}
}
class Instructor extends Person {
constructor(instructorInfo){
super(instructorInfo);
this.speacialty= instructorInfo.speacialty;
this.favLanguage= instructorInfo.favLanguage;
this.catchPhrase= instructorInfo.catchPhrase;
}
demo(subject){
console.log(`Today we are learning about ${subject}.`);
}
grade(student,subject){
console.log(`${student.name} receives a perfect score on ${subject}.`);
}
}
class Student extends Person {
constructor(studentInfo){
super(studentInfo);
this.previousBackground =studentInfo.previousBackground;
this.className= studentInfo.className;
this.favSubjects= studentInfo.favSubjects;
}
listsSubjects(){
console.log(`${this.favSubjects}`);
}
PRAssignment(subject) {
console.log(`${student.name} has submitted a PR for ${subject}.`);
}
sprintChallenge(subject){
console.log(`${student.name} has begun sprint challenge on ${subject}.`);
}
}
class Pms extends Instructor{
constructor(pmInfo){
super(pmInfo);
this.gradClassName= pmInfo.gradClassName;
this.favInstructor= pmInfo.favInstructor;
}
standUp(channel){
console.log(`${this.name} announces to ${channel}, @channel standup times!`);
}
debugsCode(student,subject){
console.log(`${this.name} debugs ${student.name}'s code on ${subject}.`);
}
}
const Josh= new Instructor({
name:'Josh',
gender:'male',
favLanguage:'JavaScript',
catchPhrase: `Don't forget the homies.`
});
const Justin= new Pms({
name:'Justin',
gender:'male',
favInstructor:'Josh'
});
const Alex= new Student ({
name: 'Alex',
gender:'male',
age: 25,
className:'cs11'
});