Skip to content

Commit

Permalink
call and this
Browse files Browse the repository at this point in the history
  • Loading branch information
justin212407 committed Sep 7, 2024
1 parent 5988aea commit 12d1e99
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions 10_classes_and_oops/call.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function SetUsername(username){
//complex DB calls
this.username = username
console.log("called");
}

function createUser(username, email, password){
SetUsername.call(this, username)

this.email = email
this.password = password
}

const chai = new creatUser("coffee", "[email protected]", "12345")
console.log(coffee);

0 comments on commit 12d1e99

Please sign in to comment.