-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclasses.js
More file actions
29 lines (25 loc) · 776 Bytes
/
classes.js
File metadata and controls
29 lines (25 loc) · 776 Bytes
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
class batch{
constructor(Name , course , department){
this.Name = Name
this.department = department
this.course = course
}
aboutBatch(){
console.log(`this is ${this.Name} and he is from ${this.department} department and he enrolled for ${this.course}`);
}
}
let Student1 = new batch("Harfool gurjar" , "BCA " , "web dev cohort")
let Student2 = new batch("ganesh gujjar" , "ba" , null)
Student1.aboutBatch()
Student2.aboutBatch()
class Mentor extends batch {
constructor(Mentor , course){
super(course, Mentor)
this.Mentor = Mentor
}
aboutMentor(){
console.log(`this is ${this.Mentor} and this mentor of ${this.course}`);
}
}
let hcSir = new Mentor("hitesh sir" , "Web dev cohort")
hcSir.aboutMentor()