Last active
November 13, 2019 13:31
-
-
Save erdemuslu/66d3b9fc8cd022ae69cc4f4570dbdf55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createUser = (firstName, lastName) => { | |
const user = {}; | |
user.firstName = firstName; | |
user.lastName = lastName; | |
user.sayHello = function() { | |
console.log(`Hello ${this.firstName} ${this.lastName}`); | |
} | |
return user; | |
} | |
const user1 = createUser('Erdem', 'Uslu'); | |
const user2 = createUser('John', 'Smith'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment