Design comparison
Solution retrospective
Feedbacks are very much appreciated.
Community feedback
- @YazdunPosted about 3 years ago
Hello Nyein and great job š I have some suggestions on this :
- First, Wouldn't it be cooler if button had some hover effects? š
- I noticed you've been used
div
for form which is not best approach, best is useform
tag itself and on submit you can use something like
btn.addEventListener("click", (e) => { e.preventDefault(); validateForm(); });
- For javascript, I noticed so many
if
andelse
which was not necessary, you can write a function for that then just pass the parameters to the function, so you can totally avoidif
andelse
repetition.
Here I have some good resources that you maybe interested in :
- DRY principle
- Javascript nuggets playlist and Javascript fundementals by John Smilga š„
ā Also I opened a pull request to your solution repo which will add a function to validate your inputs so you can get rid of some of those
if
andelse
, Also I added some hover effects to your button I hope you're ok with that šSIDE NOTE: For validate function, I wanted to add a
foreach
loop so we wouldn't need to call the function 4 times, but I thought it would get too complicated and so different from your code, so I kept it simple a little bit. You can look intomap
function yourself later on.I hope this was helpful
Marked as helpful0@CrystalNyeinPosted about 3 years ago@Yazdun Thank you so much. I'm still on my way learning so these feedbacks are very valuable for me. It'll help me improve my coding styles a lot. I'll try that function too. Thanks for the pull request too so that I can check out how I can change those code in the future usage.
0 - @Manojraj07Posted about 3 years ago
@CrystalNyein, Design looks cool!
0
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