Bastienab
3/19/2019 - 10:39 AM

Découverte de Node Js

Découverte de Node Js

process.stdin.resume()
process.stdin.setEncoding('utf8')

console.log(' How old are you ? ')
process.stdin.on('data', (number) => {
    if (number >= 100 || number < 1 || isNaN(number)) {
        console.log('Nope your dead, sorry.');
    } else {
        console.log(2019 - number)
    }
    process.exit()
})