SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 74 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('What\'s your age ? ')
  5. process.stdin.on('data', (age) => {
  6.  
  7.     const user = (age) => {
  8.  
  9.         if (isNaN(age)) {
  10.  
  11.            return "Try again!";
  12.         }  
  13.         if (age > 99 || age < 0) {
  14.  
  15.         }else{
  16.             return "Tu es nĂ© en " + (2019 - age);
  17.         }    
  18.     };
  19.   console.log(user(age));
  20.   process.exit()
  21. })
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