Make a list of colors called "colors". Remember that Lists in JS should be variables, surrounded by square brackets and that elements of the list should be in quotes and separated by commas. For instance: var colors = ["yellow" "blue", "red"] is a valid list. I used hexadecimal for my colors.
var colors = ['#020b36','#230745', '#d6fffb', 'b3e3f4s'];
We want to make the colors random, so we'll use a variable called "randomIndex", and a method of the JavaScript Math module random. Try to set that up on your own!
Since "Math.random()" returns a number between 0 and 1, we want to make that a little bigger and use the size of our list to our advantage. For a list object in JS we can get it's size by referring to the list by name, and adding the length property using the "object.method" notation from earlier, for instance: "colors.length". To make our random number in that range, let's just multiply the two.
Since "Math.random()" could be a decimal we'll use the "Math.floor()" method on the previous step to take the number and move it to the next lowest whole number. For instance: "Math.floor(6.5362)" returns 6.
var randomIndex = Math.floor(Math.random()*colors.length);
Now use a new variable randomColor and set it equal to an element of Colors. To access a single element of the list use square brackets after the name of the list and put a number inside of them. For instance 0.
Take a look at the code for the mouseover and copy from the ".style" onwards. Then back in the for loop add a new line and write "box". Now paste the color code from the Mouseover event, and adjust the blank color on the right of the equals sign to reference "randomColor" instead. Check out what happens to the boxes!