Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- process.stdin.resume()
- process.stdin.setEncoding('utf8')
- console.log('How old are you ? ')
- process.stdin.on('data', (age) => {
- date = 2019 - age;
- if (age < 99 && age > 0) {
- console.log(date)
- } else if (typeof age !== 'number') { console.log('age invalid') } else { console.log('what are you typing here ??') }
- process.exit()
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement