While I definitely think it's a good exercise to do the validation like this "by hand", I don't think this will scale as you build a product. I recently used Vest and really liked it: dev.to/roblevintennis/agnosticui-v...
Mine used Svelte, but you can use Vest with JavaScript / HTML5 forms, React, Vue, or really anything since it's just an orthogonal ES6 module. And even if you do want to "roll your own" it's certainly worth looking at their source code too.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
While I definitely think it's a good exercise to do the validation like this "by hand", I don't think this will scale as you build a product. I recently used Vest and really liked it:
dev.to/roblevintennis/agnosticui-v...
Mine used Svelte, but you can use Vest with JavaScript / HTML5 forms, React, Vue, or really anything since it's just an orthogonal ES6 module. And even if you do want to "roll your own" it's certainly worth looking at their source code too.