daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 55 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', (age) => {
  6.     let ladate = new Date()
  7.     if (age > 0 && age < 100) {
  8.         let year = ladate.getFullYear() - age
  9.         console.log('You are born in ' + year)
  10.     } else {
  11.         console.log('Enter your age')
  12.     }
  13.     process.exit()
  14. })
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