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
82 lines (76 loc) · 1.88 KB
/
Copy pathlambda-classes.js
File metadata and controls
82 lines (76 loc) · 1.88 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
// CODE here for your Lambda Classes
class Person{
constructor(args){
this.name = args.name;
this.age = args.age;
this.location = args.location;
this.gender = args.gender;
}
speak(){
return `Hello my name is ${this.name}, I am from ${this.location}`;
}
}
class Instructor extends Person{
constructor(args){
super(args);
this.specialty = args.specialty;
this.favLanguage = args.favLanguage;
this.catchPhrase = args.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(args){
super(args);
this.previousBackground = args.previousBackground;
this.className = args.className;
this.favSubjects = args.favSubjects;
}
listsSubjects(){
this.favSubjects.forEach((subject) => {
console.log(subject);
});
}
PRAssignment(subject){
return `${this.name} has submitted a PR for ${subject}`;
}
sprintChallenge(subject){
return `${this.name} has begun sprint challenge on ${subject}`;
}
}
class ProjectManager extends Instructor {
constructor(args){
super(args);
this.gradClassName = args.gradClassName;
this.favInstructor = args.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}`);
}
}
let callum = new ProjectManager({
name: "Callum",
age: 25,
gender: "M",
location: "San Francisco",
specialty: "React",
favLanguage: "JavaScript",
catchPhrase: "Good Job",
gradClassName: "CS11",
favInstructor: "Josh"
});
let tom = new Student({
name: "Tom",
age: 21,
gender: "M",
location: "wisconsin"
});
console.log(callum.debugsCode(tom,"math"));