Calculator #13 Question

I’m working on the JavaScript calculator (This one) and I used a tutorial (I used this tutorial). How could I implement #13 into my calculator?

Without seeing your code, we could randomly guess, but I think a better question might be… if you encountered that situation in real life, how might you handle it?

Suppose you saw this, written on a piece of paper:

3 + 4 + * 5

…and you knew that number 13 rule… what might you do with that + * in the middle of that?

This question actually confused me but in this case, I would ignore the multiplication sign

According to number 13, is that accurate? From what I’m seeing, if we encounter multiple operators, the last one wins. In the case of + *, the addition should be replaced by the multiplication.

I see, but how could this be done with code (I’m not using React by the way)?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.