Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 9 months ago

tip-calculator-app

react, vite
Stefan Zorbas•250
@stezor
A solution to the Tip calculator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I'm most proud of code refactoring of reducer function.

What challenges did you encounter, and how did you overcome them?

Several, however most problematic was a bug of calculateTotal and calculateTip functions and theirs return values. The problem was both of them worked fine up until values were reset to zero. Solution then was about truthy and falsy values, the fact that javascript interprets "return 0" as return boolean false and not number 0. Obviously, problems were with output but were solved by addressing falsy interpreted value.

What specific areas of your project would you like help with?

All comments r welcome :)

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Stefan Zorbas's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License