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