} add(3, 5); ---------------------------- function calculate(a, b, operation) { switch (operation) { case 'add': return a + b; case 'subtract': return a - b; case 'multiply': return a * b; case 'divide': 。 if (b === 0) { return 0; } return a / b; default: return NaN; } } calculate(3, 1, "subtract"); calculate(4, 2, "divide"); ---------------------------- function calculate(a, b, operation) { switch (operation) { case 'add': return add(a, b); ///// } } calculate(3, 1, "add");