Design comparison
Solution retrospective
I applied a few error handling cases into my program as well as use forEach loop to avoid using variables for all the buttons, I added an eventlistener to the button which would check if the button was a submit button or a rating button via checking if it contains an attribute of value. I was able to do a few tests and started using the console in the browser efficiently.
What challenges did you encounter, and how did you overcome them?I initially faced the issue of setting the rating based on assigning the value of a variable within the forEach loop but that didnt work since it was always set on a local scope and not the global one. I then directly set the value of the rating via .textContent() property within the loop which worked out pretty well.
Community feedback
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