Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. process.stdin.resume()
  2. process.stdin.setEncoding('utf8')
  3.  
  4. console.log('How old are you ?')
  5. process.stdin.on('data', age => {
  6. if (isNaN(age) == false && age < 99) {
  7. console.log('You were born in ' + ('2019' - age))
  8. console.log('✔')
  9. } else console.log('Your age is incorrect...')
  10. console.log('✘')
  11. process.exit()
  12. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement