Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
githubAmanKumar authored Mar 25, 2024
1 parent 25e50d6 commit b1be79a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions 10_Classes_and_OOP/staticprop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class User {
constructor(username){
this.username = username
}

logMe(){
console.log(`Username: ${this.username}`);
}

static createId(){
return `123`
}
}

const hitesh = new User("hitesh")
// console.log(hitesh.createId())

class Teacher extends User {
constructor(username, email){
super(username)
this.email = email
}
}

const iphone = new Teacher("iphone", "[email protected]")
console.log(iphone.createId());

0 comments on commit b1be79a

Please sign in to comment.