How to show a real time calculation in javascript?

But isn’t the total calculated in a way that’s different from just left to right?

The following “6 / 2(1 + 2)” formula helps to demonstrate the difference.

An incorrect answer is found by doing 6/2, then multiplying by 1+2

The correct answer is found by resolving the parenthesis first
6 / 2 * 3
Then applying the multiplication and divisions from left to right:
3 * 3
Until you get to the answer
9

All in all the steps are:

  • 6 / 2(1 + 2)
  • 6 / 2(3)
  • 6 / 2 * 3
  • 3 * 3
  • 9

That seems to be a different process from the “after +3 , /5 will display in slideshow” that you were mentioning.
If you have something different in mind, can you please provide further clarification?

By the way, there is a useful “step by step” formula solver that you might find useful, at https://github.com/j0hnskot/calculate.js/tree/master