Here’s a first look at the calculator I built using React:
https://codepen.io/kudeh/full/ZZbONd
Update: bugs fixed, all test cases pass…handling of button click could be better modularized.
Here’s a first look at the calculator I built using React:
https://codepen.io/kudeh/full/ZZbONd
Update: bugs fixed, all test cases pass…handling of button click could be better modularized.
I found a few problems:
When you “resolve” and equation (i.e press equals) and then press a number, it just concatenates said number onto the current answer. I don’t know if you intended this but it is not what the example does.
You can type in number decimal operator decimal etc (5 + . + . + .) This does not make sense. You cannot have a decimal without a following number.
You can start a number with multiple zeroes.
You mispelt subtract wrong as an element’s id and thus failed a test.
That’s all I have spotted for now. Good start, but I noticed you still have 8 more tests to pass. Fixing some of the four things I mentioned should go some way to passing said tests.
@kudeh Nice!
Here is my opinion:
Nice feedback, will fix my approach to the problem and get rid of those bugs
Thanks, that will make it look better. Will add that to my design