Skip to content

Commit f2589a4

Browse files
committed
Using module
1 parent d9936fb commit f2589a4

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

oop/module/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Teacher } from './teacher';
2+
3+
const teacher = new Teacher("Mbr-Sagor", "CSE");
4+
teacher.tech();
5+
teacher.walk()
6+
// const combined = [...teacher.name, " ", ...teacher.subject]
7+
console.log(teacher.name, teacher.subject);

oop/module/person.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export class Person {
2+
constructor(name) {
3+
this.name = name;
4+
}
5+
6+
walk() {
7+
console.log("Walk");
8+
}
9+
}
10+
11+
// const person = new Person("Sagor");
12+
// console.log(person);
13+
// person.walk();
14+

oop/module/teacher.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Person } from './person';
2+
3+
export class Teacher extends Person {
4+
5+
constructor(name, subject) {
6+
super(name);
7+
this.subject = subject;
8+
}
9+
10+
tech() {
11+
console.log("Tech");
12+
}
13+
}

0 commit comments

Comments
 (0)