SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 80 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('Quel est ton âge ? ')
  5. process.stdin.on('data', (age) => {
  6.  
  7.   let number = new Date().getFullYear();
  8.   if (age <= 99 && age > 0) {
  9.   let dateNaissance = number - age;
  10.  
  11.     console.log(`Tu es né en ${dateNaissance}`);
  12.  
  13.   } else {
  14.  
  15.      console.log(`Ceci n'est pas un nombre !`);
  16.  
  17.   }
  18.   process.exit();
  19. })
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