Skip to content

Commit b1be79a

Browse files
Add files via upload
1 parent 25e50d6 commit b1be79a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

10_Classes_and_OOP/staticprop.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
class User {
2+
constructor(username){
3+
this.username = username
4+
}
5+
6+
logMe(){
7+
console.log(`Username: ${this.username}`);
8+
}
9+
10+
static createId(){
11+
return `123`
12+
}
13+
}
14+
15+
const hitesh = new User("hitesh")
16+
// console.log(hitesh.createId())
17+
18+
class Teacher extends User {
19+
constructor(username, email){
20+
super(username)
21+
this.email = email
22+
}
23+
}
24+
25+
const iphone = new Teacher("iphone", "[email protected]")
26+
console.log(iphone.createId());

0 commit comments

Comments
 (0)