I have a rate number for 3 different products,
and i am trying to render a star svg base of number of rate.
for example product A has rate 3, I want to render star img, 3 times.
the maximum star they can have is 5.
i wrote a code like this
for (let i = 0; i < productRate + 1; i++) {
console.log(productRate);
return `<img src="assets/star.svg" alt="rating-star" />`;
}
};```
product rate shows the number of rating number correctly for each product, but the render in the loop doesn't render base of that number