Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.
I had the need to repeat something in JSX.
The use case was this: I had a rating from 1 to 5, and based on the value I wanted to display some stars, from 1 to 5 stars.
So I used this snippet:
<p>
{[...Array(rating)].map(() => '⭐️ ')}
</p>