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
86 lines (68 loc) · 2.14 KB
/
Copy pathlambda-classes.js
File metadata and controls
86 lines (68 loc) · 2.14 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
// CODE here for your Lambda Classes
class Person {
constructor(person){
this.name = person.name;
this.age = person.age;
this.location = person.location;
this.gender = person.gender;
}
speak(){
console.log(`Hello my name is ${this.name}, I am from ${this.location}.`)
}
}
var Mason = new Person ({
name: "Tommy", age: 24, location: "Seattle", gender: "male",
})
Mason.speak();
class Instructor extends Person {
constructor(instructor) {
super(instructor);
this.speciality = instructor.speciality;
this.favLanguage = instructor.favLanguage;
this.catchPhrase = instructor.catchPhrase;
}
demo(subject) {
console.log(`Today we are learning about ${subject}`);
}
grade(student, string) {
console.log(`${student.name} receives a perfect score on ${subject}`);
}
sayCatchPhrase(){
console.log(this.catchPhrase);
}
}
var DanF = new Instructor ({
name: "Dan", age: 24, location: "SLC", gender: "male", speciality: "coding", catchPhrase: 'Goooood evening everyone',
})
DanF.demo(`JS4`)
// console.log(DanF.catchPhrase);
DanF.sayCatchPhrase() // this doesn't work yet, but will reexamine tomorrow.
class Student extends Person {
constructor(student) {
super(student)
this.previousbackground = student.previousbackground;
this.className = student.className;
this.favSubjects = student.favSubjects;
}
prAssignment(subject) {
return `${student.name} has submitted a PR for ${subject}`;
}
sprintChallenge(subject) {
return `${student.name} has begun sprint challenge on ${subject}`;
}
listSubjects(){
return `{...favSubjects}`;
}
}
class ProjectManager extends Instructor {
constructor(attributes) {
this.gradClassName = projectManagerOptions.gradClassName;
this.favInstructor = projectManagerOptions.favInstructor;
}
standUp(channel) {
return `{name} announces to {channel}, @channel standy times!`;
}
debug(student, subject) {
`{name} debugs {student.name}'s code on {subject}`;
}
}