-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathlambda-classes.js
More file actions
82 lines (73 loc) · 2.48 KB
/
lambda-classes.js
File metadata and controls
82 lines (73 loc) · 2.48 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(attributes){
this.newName = attributes.newName
this.newAge = attributes.newAge
this.newLocation = attributes.newLocation
}
speak(){
return `Hello my name is ${this.newName}, I am from ${this.newLocation}`
}
}
class Instructor extends Person{
constructor(instructorAttributes){
super(instructorAttributes);
this.newSpecialty = instructorAttributes.specialty
this.newFavLanguage = instructorAttributes.favLanguage
this.newCatchPhrase = instructorAttributes.catchPhrase
}
demo(subject){
return `Today we are learning about ${subject}` //Need to add a subject string as an argument
}
grade(student, subject){
return `${student.name} receives a perfect score on {subject}` //Need to add student as an object and a subject string as arguments
}
}
class Student extends Person{
constructor(studentAttributes){
super(studentAttributes);
this.previousBackground = studentAttributes.previousBackground
this.className = studentAttributes.className
this.favSubjects = studentAttributes.favSubjects
}
listsSubjects(){ //need a method that logs out all of the student's favoriteSubjects one by one
}
PRAssignment(){ //need a method that receives a subject as an argument and logs out that the student.name has submitted a PR for {subject}
return `${student.name} has submitted a PR for ${subject}`
}
sprintChallenge(){
return `${student.name} has begun sprint challenge on ${subject}`
}
}
class ProjectManagers extends Instructor{
constructor(ProjectManagersAttritubes){
super(ProjectManagersAttritubes);
this.gradClassName = ProjectManagersAttritubes.gradClassName
this.favInstructor = ProjectManagersAttritubes.favInstructor
}
standUp(){
return `${name} announces to ${channel}, @channel standy times!`
}
debugsCode(student){
return `${name} debugs ${student.name}'s code on ${subject}`
}
}
const Steve = new Person({
name: 'Steve',
age: 41,
location: 'Seattle',
})
const Brit = new Instructor({
specialty: 'teaching',
favLanguage: 'JavaScript',
catchPhrase: 'Ehhhh',
})
const Skippy = new Student({
previousBackground: 'McDonalds',
className: 'Web23',
favSubjects: 'HTML',
})
const Tyler = new ProjectManagers({
gradClassName: 'Web1',
favInstructor: 'Shanaynay',
})