Welcome to my algebra expression (or equation) simplifier, made with vanilla JavaScript! It supports addition, subtraction, division (by numbers only), multiplication, and exponents.
To see it in action, go here. To see the code, go to script.js
.
Go to script.js
to see the commented code. The function doAll("...")
simplifies something.
On a high level, it works by parsing the expression as a string (it doesn't convert the expression into computer-readable code). I started by making a parser for just arithmetic, and then expanded it to work with variables as well.
I've done a lot of debugging with this but there's probably still bugs in there. If you find one, please let me know by starting an issue.