Callbacks and Higher-Order Functions
What is the output of the following code?
function calculate(x, y, operation) {
return operation(x, y);
}
const result = calculate(5, 3, function(a, b) {
return a * b;
});
console.log(result);
function calculate(x, y, operation) {
return operation(x, y);
}
const result = calculate(5, 3, function(a, b) {
return a * b;
});
console.log(result);