Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 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', (text) => {
  6. if (text <= 99) {
  7. console.log(`So... You're born in ${2019 - text}`)
  8. }
  9. else {
  10. console.log(`You're too old for us, sorry... :(`)
  11. }
  12. process.exit()
  13. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement