This commit is contained in:
Karan
2021-11-24 20:31:27 +05:30
parent 305bcf7b9b
commit cb2f78df51
6 changed files with 0 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
const val1 = 10;
const val2 = 5;
let operat = "-";
console.log(cal(val1, val2, operat));
operat = "+";
console.log(cal(val1, val2, operat));
function cal(a, b, op) {
if (op == "-") {
return a - b;
} else {
return a + b;
}
}