How to write the logical partition and regular expression of a JS program that can calculate the expression 1-(2 * (3-4) + 5 / (6-7)) + (- 8-9)?

try to write down the calculator with JavaScript. Once the computational complexity comes up, such as the expression 1-(2 * (3-4) + 5 / (6-7) + (- 8-9), it always enters an endless loop from all angles and consumes call stack resulting in an error. Is there an open source calculator program written regularly for JavaScript?


doesn't need a regular, just a stack, and then read it sequentially.

Menu