Javascript Calculator & Order of Operations

Javascript Calculator & Order of Operations
0

#1

How do I tackle Mathematical Order of Operations from user inputs in the JS Calculator Challenge?

3+1x3 = 6; NOT 12

The example calculator, given to us, does not function correctly and I’m at a loss as to where to find solutions to this …

any help would be much appreciated, it’s driving me crazy …


#2

You gonna have to do it the hard way. Parse the string to find all the operator and the associate operand. Then put them in order to perform the calculation.

Do small pieces at a time. Like find the operator.
Then the operand.


#3

that’s what I was afraid of … it came to me after I posted the question … gonna be an arduous task … but SO WORTH IT … thanks :thumbsup: