- Generate 6 random numbers from 1 – 45
- Check for duplicates
- Store these number in an array
- Sort the array in ascending order
- Create an html element to hold each array value
- Append the array value to each element
- Delete circle elements before function starts
The CSS file contains styling for the layout, font, circles, hr elements, and the background image.
I first created an empty array. I then created a function that will keep iterating through until my array reaches 6 random values. If the value is a duplicate it will not add it into the array and continue until 6 different values are reached. In the next step, I sort the array into ascending order and stored those results into an array called sorted. I then used a foreach function. For each element of the array, I create a span element and add the circle class and m-3 classes to it. I then set the value of each circle element to the value of the array and I appended each element to my existing html.