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 28, 2024
1 parent 72a9055 commit f41e6c8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions 10_Classes_and_OOP/getter_setter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class User {
constructor(email, password){
this.email = email;
this.password = password
}

get email(){
return this._email.toUpperCase()
}
set email(value){
this._email = value
}

get password(){
return `${this._password}hitesh`
}

set password(value){
this._password = value
}
}

const hitesh = new User("[email protected]", "abc")
console.log(hitesh.email);

0 comments on commit f41e6c8

Please sign in to comment.