Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

tip-calculator sass and debounce function

@VladimirBrscic

Desktop design screenshot for the Tip calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


I tried to make JavaScript code really easy to read. Beast I could. Please tell me how I did. Many thanks :-)

Community feedback

@oliverids

Posted

Hey, your code is really neat and works just great!

I'd suggest using the "input" event instead of "keyup" if you want a more imediate trigger, but that's not necessary if you don't want it.

Also, for better usability, I suggest not letting the calculator do its thing until the person types the number of people. Your code says that when the value of the input is zero, to use "1" as default value. However, a random user can't see that, and they might think there's an error. I think something like this would be enough for you:

if (input.value.length) { ..function.. }

Nice job!!

Marked as helpful

0

@VladimirBrscic

Posted

@oliverids Thanks a lot for your suggestions!

0

Please log in to post a comment

Log in with GitHub
Discord logo

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