Created
March 3, 2017 01:09
-
-
Save greemwahr/31eed98eccebc4c4e07be05c82f00ea3 to your computer and use it in GitHub Desktop.
RisingStack Node Hero Readline Challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
// app/readlineCalc.js | |
const readline = require('readline') | |
// const calc = require('./calc') | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}) | |
const sum = () => { | |
rl.question('Please input the first number you would like to sum: ', (input1) => { | |
rl.question('Please input the second number you would like to sum: ', (input2) => { | |
const results = +input1 + +input2 | |
console.log(`This is the result of two numbers: ${results}`) | |
rl.close() | |
}) | |
}) | |
} | |
module.exports.sum = sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment