Efficient error management with JS using DS. Success alert 2s long.
Design comparison
Solution retrospective
Having a compact JS code. DS have a lot of potential, in my opinion, not only reducing asymptotic ejecution time costs, but enhancing readability. Also, with larger projects in mind in a future, it's a must to take care of the code.
What challenges did you encounter, and how did you overcome them?It is necessary to establish regular expressions. They are very commonly used for validating the requirements of each field in forms.
I first started looping over the input.value, having lots of booleans (e.g. for the email: one for the @, other for the dot...), etc. That's completely unfeasible. So I found these expressions that save a lot of work, for example for the email format: /^[^\s@]+@[^\s@]+\.[^\s@]+$/
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