beginning to calc app
This commit is contained in:
parent
e49d664c04
commit
c39aa9e957
14
calculator.js
Normal file
14
calculator.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
const prompt = require("prompt-sync")({sigint: true});
|
||||||
|
|
||||||
|
function add(a, b) {
|
||||||
|
let e = a + b;
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
let c = prompt("Num 1: ");
|
||||||
|
let d = prompt("Num2: ");
|
||||||
|
let op = prompt("What operation? ");
|
||||||
|
|
||||||
|
if (op == "+") {
|
||||||
|
console.log(Number(c) + Number(d));
|
||||||
|
}
|
2
node_modules/.package-lock.json
generated
vendored
2
node_modules/.package-lock.json
generated
vendored
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "javascript-sandbox",
|
"name": "sandbox-js",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "javascript-sandbox",
|
"name": "sandbox-js",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
Loading…
Reference in New Issue
Block a user