Declare the variable add and assign it a function which takes two arguments, operand1 and operand2, and returns the sum of those arguments.
Declare the variable calculate and assign it a function which takes three arguments, operand1, operand2 and operation.
Inside the body of calculate, invoke the function passed as the argument operation, passing as arguments operand1 and operand2, and print the result of this invocation to the console.
Don’t forget to invoke calculate passing it the add function as a third argument.
…
var add = function (operand1, operand2){
return operand1 + operand2;
};
var calculate = function (operand1, operand2, add) {
return operand2 + add;
};
Output
Code is incorrect
Create a variable in the body of the calculate function to invoke the function received as argument