Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 7 months ago

Responsive Tip Calculator app using JavaScript

P
Matt Pahuta•650
@MattPahuta
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?

While the logic of a tip calculator app isn't particularly complex, I'm happy with where I ended up with the separation of functions into a series of compact, specialized 'do-one-thing' functions.

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

I went through several iterations of the form validation, eventually settling on an object to reference and hold the logic. Reviewing the 'refactoring your code' chapter of the JS fundamentals path was helpful in putting it all together.

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

I'm falling short with some accessibility features with this app and would need to spend a good deal more time on that aspect before feeling it's truly a production-ready site.

I also don't like leaving empty elements (p tags for the error messages in this instance) as part of my markup. A future iteration of the project would be to enhance the code to dynamically create/remove the elements as part of the error messaging rendering functions.

Finally, I spent some time working on a currency auto-formatting function for the bill amount input but it didn't make it into the project just yet. Again, that's a candidate for future enhancements.

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 Matt Pahuta'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
Frontend Mentor logo

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

Frontend Mentor

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

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub