I recently watched a tutorial on codecademy about randomizing color arrays, but I'm still struggling to get my colors to appear random. It seems like something is not quite right in my code.
function getRandomColor() {
var color;
var colorArray = [
"#FF6633",
"#FFB399",
"#FF33FF",
"#FFFF99",
"#00B3E6",
"#E6B333",
"#3366E6",
"#999966",
"#809980",
"#E6FF80",
"#1AFF33",
"#999933",
"#FF3380",
"#CCCC00",
"#66E64D",
"#4D80CC",
"#FF4D4D",
"#99E6E6",
"#6666FF"
];
for (var i = 0; i < colorArray.length; i++) {
color = colorArray[Math.floor(Math.random() * colorArray.length)];
}
return color;
}