Design comparison
Solution retrospective
I'm very proud to have written possibly good code, structured much better than my usual.
What challenges did you encounter, and how did you overcome them?The biggest challenge was definitely how to retrieve the correct values and pass them to the function that calculates the tips. In the end, I opted to call the function on every input:
billNumber = Number(event.target.value); calculate(); });
To prevent it from being executed when the values are not ready, I used an if statement:
if (billNumber && tipNumber && peopleNumber)
For the custom button, I always used type='radio'
. I think I could simply use type='number'
.
Community feedback
- @shalriPosted 6 months ago
Good job on the design sir! Although, the Custom tip is not working as expected the rest of the app is working properly.
0
Please log in to post a comment
Log in with GitHubJoin 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