Skip to content

Instantly share code, notes, and snippets.

@imkrish
Created November 9, 2019 05:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save imkrish/0c5fbe499fa6d6afeb63f0e4e99f8a60 to your computer and use it in GitHub Desktop.
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