Design comparison
Solution retrospective
Hello everyone! This is my second Frontend Mentor challenge. I'm a beginner, so any suggestions or comments are welcome! Thanks so much!
Edit: I can't understand why only the first section of my solution appears in the "Design Comparison". In the preview of the site, however, everything seems to work correctly.
Community feedback
- @yasssuzPosted over 3 years ago
Hello Aurora!
Awesome build, just a few tips for the javascript:
- You're executing an event listener the first time the window loads. In this case, your javascript is pretty small, so you shouldn't have performance problems. But this is something that you should try to avoid. A solution would be
form.addEventListener('submit', () => ...)
, this will execute the code only when the form is submitted. - Is a very good practice to make each function to do something different. I strongly suggest isolating each function, here is an example:
function validateField() { const pattern = (regex here) const inputValue = input.value inputValue.match(pattern) ? validField() : notValidField() } //then you create these functions that will render error and stuff
For any question or suggestion feel free to ask :)
Upvote my comment if I was helpful and happy coding :)
1@Auro-93Posted over 3 years ago@Galielo-App Thanks so much for the tips! These days I'm reviewing the code and I will treasure the advice for the next projects :)!
0 - You're executing an event listener the first time the window loads. In this case, your javascript is pretty small, so you shouldn't have performance problems. But this is something that you should try to avoid. A solution would be
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