A simple small code replacement for js eval
It can accept mathematical expression based on a string only.
It accepts currently only:
- Addition
- Subtraction
- Multiplication
- Division
- Exponentation
Eval(" 1 + 1"); //returns 2
Eval("10 - 5"); //returns 5
Eval("6 * 2"); //returns 12
Eval("14 / 7"); //returns 2
Eval("2 ^ 2"); //returns 4