Fixed: function name not match

This commit is contained in:
upupming 2018-07-15 13:28:30 +08:00
parent 48ca820ac3
commit a45492a800

View file

@ -17,7 +17,7 @@ The task consists of two parts.
alert( calc.calculate("3 + 7") ); // 10 alert( calc.calculate("3 + 7") ); // 10
``` ```
2. Then add the method `addOperator(name, func)` that teaches the calculator a new operation. It takes the operator `name` and the two-argument function `func(a,b)` that implements it. 2. Then add the method `addMethod(name, func)` that teaches the calculator a new operation. It takes the operator `name` and the two-argument function `func(a,b)` that implements it.
For instance, let's add the multiplication `*`, division `/` and power `**`: For instance, let's add the multiplication `*`, division `/` and power `**`: