BUG in Demo app: Build a JavaScript Calculator

BUG in Demo app: Build a JavaScript Calculator
0

#1

HI guys!

I was checking the demo app in the “Build a JavaScript Calculator”. I think the Demo does wrong mathematical operations chaining (see picture attached).

*I couldn’t check the code since I have to do the challenge. :slight_smile:


#2

Personal choice whether you choose to build a scientific calculator or not. If you can track down a basic 4-function calculator like this one I think that you’ll find that it evaluates each operation as it’s input. In fact, if you are on a windows computer and set the calculator to “standard” you’ll see it.




#3

I don’t have a link to it anymore, but a couple of years ago someone built a perfect replica of the high end graphing calculator they used in high school and college. It was a wonder to behold.

Most people settle for more along the lines of the free one your bank gives you, although I have seen campers add ( and ) to allow for longer expressions.


#4

I can understand that, except that the demo App visually is chainning operations rather than showing the result as you add operations (like in your example). Which can be misleading in regards to the user story.

I can keep chaining mathematical operations together until I hit the equal button, and the calculator will tell me the correct output.


#5

I agree, the way it does this is ‘wrong’ in terms of order-of-operations. Make yours better!


#6

I opened the same post some weeks ago. In the beta version this problem is not there anymore.
I suppose dat add “(” at the start and “)” at the end of the lines gives more sense.


#7

See the following post where I explain why there is more than one “right” way to build a calculator.