Divide the problem into smaller problems and solve those.
Easy one mate
Switch statement
nested ternary operator? xD
maybe you can declare static methods inside with operation names?:) function calculate(operand1, operand2, operation) { return calculate[operation](operand1, operand2) } calculate.multiply = (operand1, operand2) => operand1 * operand2
Обсуждают сегодня