Guest User

Untitled

a guest
Oct 23rd, 2019
77
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