Design comparison
Solution retrospective
The biggest challenge was trying to catch every single error. I had problem with set JS functions to block submit form with any error. Finally form works well, it's impossible to submit form with error. I've learned more about forEach()
function.
Community feedback
- @IvanFdez01Posted 3 months ago
Hi,
That's an excellent JS code in mi opinion, at this level at least. If I had to make an adjustment in the part where you mentioned you would struggle (how to block Submit when errors exist), I would carry a
boolean
, either globally or through parameters, across all five functions. If in checkErrors() the value is false, then don't allow Submit. This way, you avoid looping in checkErrors().I know it's not a big deal, but time costs can become important when working with larger data.
Cheers, great job.
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