Design comparison
Solution retrospective
First time writing JS, please do give criticism if I could improve anywhere. I taught about implementing a for in the getValue() function but I don't know how / don't know if it's better optimized than with the single if else condition I used.
Community feedback
- @ApplePieGiraffePosted over 1 year ago
Hey, AlexMagargiu! π
Well done on this challenge! π I think you did a good job on the styling and your solution looks good! π
I would suggest leaving the
alt
text for the icon and maybe even illustration in this challenge empty, since they aren't relevant to the content of the page and we don't really want them to be noticed and read by screen readers.And a small tip for your JSβrather than call
getValue
inside ofswitchDisplay
, you can callswitchDisplay
inside ofgetValue
if the user has selected an option. This will make your code slightly easier to follow and you won't have to bother with returning a boolean fromgetValue
. πKeep practicing and with time you'll find better and better solutions to problems you encounter. π
Hope you find this helpful. π
Keep coding (and happy coding, too)! π
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