SHARE
TWEET

Untitled

a guest Oct 19th, 2019 91 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.   const birthYears = 2019 - age
  7.   if (age > 99 || isNaN(age)){
  8.     console.log("Tu dois entrer un âge inférieur à 99")
  9.   }else if (birthYears === 2019){
  10.     console.log("La date de naissance doit être inférieur à 2019")
  11.   }else {
  12.     console.log("Ton année de naissance est " + birthYears)
  13.     process.exit()
  14.   }
  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