Skip to content

Instantly share code, notes, and snippets.

@evadav
Created April 4, 2019 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save evadav/321670ff46e2494ab5218739d5dc33bc to your computer and use it in GitHub Desktop.
Save evadav/321670ff46e2494ab5218739d5dc33bc to your computer and use it in GitHub Desktop.
My first application Node.JS
process.stdin.resume()
process.stdin.setEncoding('utf8')
console.log('How old are you ? ')
process.stdin.on('data', (age) => {
console.log('you are' + age.trim() +'years old')
if (age > 99){
console.log ('Too old')
} else {
var year = 2019;
var birth = year - age;
console.log('you were born in '+ birth)
}
process.exit()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment