Created
May 21, 2021 17:04
-
-
Save appoll/f9994f10d7ec30546dc273a83889c0cc 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
readlineSync = require('readline-sync') | |
console.log("BEFORE") | |
userName = readlineSync.question("What is your name?\n"); | |
console.log("Nice to meet you, " + userName); | |
console.log("AFTER") | |
limit = 1970; | |
// hardcoded value; | |
// how to make this come from the user? | |
age = 50; | |
currentYear = 2021; | |
birthYear = currentYear - age; | |
if (birthYear > limit) | |
{ | |
console.log("Younger"); | |
} else if (birthYear < limit) | |
{ | |
console.log("Older"); | |
} else { | |
console.log("BINGO"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment