-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathlambda-classes.js
More file actions
91 lines (81 loc) · 2.28 KB
/
lambda-classes.js
File metadata and controls
91 lines (81 loc) · 2.28 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
// CODE here for your Lambda Classes
'use strict';
class Person{
constructor(atts){
this.name = atts.name
this.age = atts.age,
this.location = atts.location;
}
speak(){
return `Hello my name is ${this.name}, I am from ${this.location}.`
}
}
class Instructor extends Person{
constructor(attr){
super(attr);
this.specialty = attr.specialty,
this.favLanguage = attr.favLanguage,
this.catchPhrase = attr.catchPhrase;
}
demo(){
this.subject = attr.subject,
`Today we are learning about ${this.subject}`
}
grade(){
this.student = attr.student,
`${this.student} receives a perfect score on ${this.subject}`
}
}
class Student extends Person{
constructor(attx){
super(attx);
this.previouseBackground = attx.previouseBackground,
this.className = attx.className,
this.favSubjects = attx.favSubjects;
this.prSubject = attx.prSubject,
this.sprintSubject = attx.sprintSubject
}
listSubjects(){
return(this.favSubjects)
}
PRAssignment(){
return(`${this.name} has submitted a PR for ${this.prSubject}.`)
}
sprintChallenge(){
return (`${this.name} has begun sprint challenge on ${this.sprintSubject}.`)
}
}
class ProjectManager extends Instructor{
constructor(attz){
super(attz);
this.gradClassName = attz.gradClassName,
this.favInstructor = attz.favInstructor,
this.channel = attz.channel,
this.studentName = attz.studentName,
this.subject = attz.subject;
};
standUp(){
return(`${this.name} announces to ${this.channel}, @channel standy times!`)
}
debugsCode(){
return(`${this.name} debugs ${this.studentName}'s code on ${this.subject}.`)
}
}
const aasa = new Student({
name: 'Aasa',
age: 30,
location: 'Virginia',
previouseBackground: 'Doctor',
className: "Web24",
favSubjects: 'math, science, english',
prSubject: 'JavaScript IV',
sprintSubject: 'Advanced CSS'
});
const tom = new ProjectManager({
name: 'Thomas',
studentName: 'Aasa',
subject: 'advanced CSS'
});
console.log(aasa.favSubjects)
console.log(aasa.sprintChallenge())
console.log(tom.debugsCode())