SHARE
TWEET

Untitled

a guest Oct 18th, 2019 90 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. let year = 2019
  5.  
  6.  
  7. console.log('What\'s your age ? ')
  8. process.stdin.on('data', (value) => {
  9.     value = Number(value);
  10.     if (value > 99){
  11.         console.log('Value is too high')
  12.     } else {
  13.         console.log(year-value)
  14.         process.exit()
  15.     }
  16.  
  17.     process.exit()
  18.    
  19.    
  20. })
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top