Advertisement
Lio-code

Découverte de NodeJS

Mar 29th, 2020
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. process.stdin.resume()
  2. process.stdin.setEncoding('utf8')
  3.  
  4. console.log('How old are you?')
  5. process.stdin.on('data', (text) => {
  6. if (!isNaN(text) && text<100 && text>0) {
  7. console.log(2020-text)
  8. }
  9. process.exit()
  10. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement