abedaarabi / hyf-homework

0 stars 2 forks source link

Homework Feedback JS 2 Week 3 #1

Closed r0hitsharma closed 5 months ago

r0hitsharma commented 5 years ago

https://github.com/abedaarabi/hyf-homework/blob/4563ddf985b9e5e71d57846701b61c55d1e34367/javascript/javascript2/main.js#L15

While it's not completely bad to put the follow up to if statement on the same line, it's rather more clear if you put it on the next line and use closures as well. Particularly when you're not using ; as much.

https://github.com/abedaarabi/hyf-homework/blob/4563ddf985b9e5e71d57846701b61c55d1e34367/javascript/javascript2/main.js#L12

It's always better to give the user some feedback in case of no-operation (no-op). You can make this more automatic by adding validation on the input field in your html file.

Try also implementing the reset case if you have the time, that can be challenging.