-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathlambda-classes.js
More file actions
77 lines (65 loc) · 2.03 KB
/
lambda-classes.js
File metadata and controls
77 lines (65 loc) · 2.03 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
// CODE here for your Lambda Classes
class Person {
constructor(atributes) {
this.name = atributes.name;
this.age = atributes.age;
this.location = atributes.location;
}
speak() {
console.log(`Hello my name is ${this.name}, I am from ${this.location}`);
}
}
class Instructors extends Person {
constructor(instructorAttrs) {
super(instructorAttrs);
this.specialty =instructorAttrs.specialty;
this.favLanguage = instructorAttrs.favLanguage;
this.catchPhrase = instructorAttrs.catchPhrase;
}
demo(subject) {
console.log(`Today we are learning about ${subject}`)
}
grade(student, subject) {
console.log(`${this.name} receives a perfect score on ${subject}`);
}
}
class students extends Person {
constructor(studentAttrs) {
super(studentAttrs);
this.previousBackground = studentAttrs.previousBackground;
this.className = studentAttrs.className;
this.favSubjects = studentAttrs.favSubjects;
}
listsSubjects() {
console.log(this.favSubjects); //how to log favoriteSubjects one by one
}
PRAssignment(subject) {
console.log(`${this.name} has submitted a PR for ${subject}`);
}
sprintChallenge(subject) {
console.log(`${this.name} has begun sprint challenge on ${subject}`);
}
}
class ProjectManagers extends Instructors {
constructor(pmAttrs) {
super(pmAttrs);
this.gradClassName = pmAttrs.gradClassName;
this.favInstructor = pmAttrs.favInstructor;
}
standUp(channel) {
console.log(`${this.name} announces to ${channel}, @channel standy times!`);
}
debugsCode(student, subject) {
console.log(`${this.name} debugs ${student}'s code on ${subject}`);
}
}
const fred = new ProjectManagers ({
name: 'Fred',
location: 'Bedrock',
age: 37,
favLanguage: 'JavaScript',
specialty: 'Front-end',
catchPhrase: `Don't forget the homies`,
gradClassName: 'webPT10',
favInstructor: 'Keiran'
});