SHARE
TWEET

Untitled

a guest Oct 18th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. process.stdin.resume()
  2. process.stdin.setEncoding('utf8')
  3.  
  4. console.log('How old are you ? ')
  5. process.stdin.on('data', (num) => {
  6.   num = parseInt(num)
  7.   if(typeof(num) == 'string'|| isNaN(num) == true || (2019-num) >= 2019){
  8.     console.log('The value is incorrect')
  9.   }else if (num > 99){
  10.     console.log('You can\'t be this old, time to DIE')
  11.   }else{
  12.     console.log('You are born in  ' + (2019-num))
  13.   }
  14.   process.exit()
  15. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top