Created
November 9, 2019 05:25
-
-
Save imkrish/0c5fbe499fa6d6afeb63f0e4e99f8a60 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function getRandomNumber() { | |
return Math.floor(Math.random() * 100); | |
} | |
function isEvenNumber(number: number) { | |
return number % 2 == 0; | |
} | |
function getPerson() { | |
if (isEvenNumber(getRandomNumber())) { | |
return { | |
name: { | |
firstName: 'Keerati', | |
lastName: 'Limkulphong', | |
getFullName: function() { | |
return `${this.firstName} ${this.lastName}`; | |
} | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment