Reputation: 73
What does # mean in the following code?
function rndm_colour(){
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color
}
Upvotes: 0
Views: 113
Reputation: 36
The code creates a random color in the HEX format. All HEX colors always start with a "#".
Upvotes: 2
Reputation:
It looks like this function generates a random HTML Color code, which begins with a #
.
Upvotes: 2