in

Javascript Basic calculator with parameters–not getting output


below is the problem.

Basic calculator with parameters
In this lab, we will practice for loop with an array and functions and conditionals. Your task for this lab is to:

Create a function named performMath that accepts three parameters – number1, number2 and operation
If operation is ‘+’, add the numbers and return the result
If operation is ‘*’, multiply the numbers and return the result

My code for aforementioned code,but am not getting correct result, please check and confirm do i code correctly?

let number1 =20
let number2 =10
function performMath(number1,number2){
return number1 + number2
}
console.log(performMath(number1 + number2));



Source: https://stackoverflow.com/questions/70558661/javascript-basic-calculator-with-parameters-not-getting-output

KD – A fantastic game created in python with pygame

Quick Tip: How to Remove a System Property in Java