msiesse
@msiesseAll comments
- @VishwajeetBarveSubmitted about 2 years ago@msiessePosted about 2 years ago
Hi Vishwajeet. Nice job completing this challenge. I’ve got a few suggestions for you to have a better code:
-
I see that you use two times forEach to check if a number has been selected or not. You don’t really need it if you use properly the
<form>
tag with<input type=« button »>
. The logic will be handled automatically, you can check Form and Input -
Rather than having a function
change
that will replace everything, you can have two components with approximately same styling and play with the CSS propertydisplay
. First the rating component will be displayed, then Thank you component -
Maybe make the component bigger, it’s a bit too small at first sight
0 -
- @SamjolasSubmitted about 2 years ago@msiessePosted about 2 years ago
Hello Samuel ! Nice job completing the challenge !
I’ve seen a little mistake on your live site, it looks like it’s possible to select multiple value for rating. So when we select a value like
5
for example and then we select4
, the previous choice is not unfocused.0 - @Kirito-san-88Submitted about 2 years ago@msiessePosted about 2 years ago
Hello, Nice job completing this challenge. I’ve got some suggestions concerning your javascript code:
-
You can use the
forEach
method rather than afor
loop. It doesn’t improve performance here but it will be more pleasant to read. You can read more about it there -
Rather than commenting about your variables, give them a better name. for instance rather than naming the submit button
button
, name itsubmitButton
, so you don’t need to write a comment. -
Better to use
const
rather thanlet
here because these variables should not be reassignables
0 -