You can also add subtraction multiply and divide and complete any arithmetic you need. This is the second part of my weekly series on how to write a math expression evaluator in JavaScript. They can be called with variables bound to passed-in values.
Var expression new String 2 2.
It has built-in support for common math operators and functions. A simple to use and efficient evaluator for math expressions in Javascript. Using the function mathevaluate expr scope. Nashorn invoke dynamics feature introduced in Java 7 to improve performance.