hi there! 👋
Instead of creating an array, pushing value to the array and updating the error message depending on that value you can just create the HTML element with the text, hide it with display: none;
in CSS and toggle it when the input fields value doesn't get through the validation.
Also you're not validating the email, you just check if there a '@' in it. Mostly email validation is done with JS regular expression
and the test
method.
Hope this was helpful 🙏 Good luck and happy coding! 💪
Marked as helpful