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) => {
- let actualYear = 2019;
- let birthday = function(age) {
- if (age < 99 && age > 0) {
- return actualYear - age ;
- } else {
- return 'another century';
- }
- }
- console.log('You are born in ' + birthday(age));
- process.exit();
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement