Hi there,
after long days of coding and handling the craziest edge cases I think I did it. I just miss one project to get my frontend certification and I’m surprised…
This is the link to my React Calculator
Hope there are no more bugs
Sergio
Hi there,
after long days of coding and handling the craziest edge cases I think I did it. I just miss one project to get my frontend certification and I’m surprised…
This is the link to my React Calculator
Hope there are no more bugs
Sergio
hey
i liked the layout, you did well with the design, however i guess you forgot to handle the user story n°13
User Story #13: If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative ( -
) sign). For example, if 5 + * 7 =
is entered, the result should be 35
(i.e. 5 * 7
); if 5 * - 5 =
is entered, the result should be -25
(i.e. 5 * (-5)
).
Hey there,
thanks for the feedback!
I dind’t forget, simply I don’t like that…I think is a cleaner way to do it like I dit, just change the operator on the fly.
Your calculator looks good @Eidan. Some things to revisit;
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
)
I’m not sure I understand this response. It’s not the way math, or a calculator, works.
5 * -5 is valid and should produce -25
On a side note, do a search and find out why you don’t want to use the eval function.
You are aboslutely right. I must pass all tests to be valid. I need to change that!
Hey there, all the tests are passed now. Thank you very much again.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.