Design comparison
Solution retrospective
I was able to work through the javascript and use console.log for testing. I was also able to refactor some of my code and make helper functions to make my code a little bit cleaner. Next time I will try to make it even cleaner.
What challenges did you encounter, and how did you overcome them?The javascript was still difficult. I had to look some little things up because I would forget how to do some things. It was also hard to make my javascript not too messy. I was able to refactor some things but I know that it can still be a lot cleaner and more effective. That will come with practice.
The responsiveness also gave me trouble. I figured out through testing that its because I had all of inputs wrapped in a form tag but I was applying my CSS grid to the calculator container so it was ignoring it. I will learn from that and not make that same mistake next time because it took me a while to figure out.
What specific areas of your project would you like help with?Regarding my javascript, are there ways to make it more efficient and cleaner/more readable? I want to practice making the cleanest code that I can.
Community feedback
- @bartoszdudziak-devPosted 7 months ago
Hello! I've noticed a few things that you could improve.
- It would be good to create a validation because in your solution user is able to enter negative numbers. You can add some error messages for the user.
- Using label tags with tip options doesn't look correct for me. I would use simply buttons for the tip options
- Consider using event delegation. It makes your code more efficient, because you can create only one event listener on your radio buttons container not for each input separately. This video may be helpful.
Can't help much with clean code cuz I am still learning that 😅 I hope it will be useful 😀 Good luck!
1
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