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', (num) => {
- num = parseInt(num)
- if(typeof(num) == 'string'|| isNaN(num) == true || (2019-num) >= 2019){
- console.log('The value is incorrect')
- }else if (num > 99){
- console.log('You can\'t be this old, time to DIE')
- }else{
- console.log('You are born in ' + (2019-num))
- }
- process.exit()
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement