I am beginner in javascript coding and i am got this error when i load my first program in chrome browser teach me what it is
code:
var target;
var select;
var colors = ["brown", "cyan", "yellow", "red", "blue", "green", "black", "white", "purple", "pink"];
var finished = false;
function do_game() {
var random_color = Math.floor(Math.random() * colors.length);
target = colors[random_color];
}
while (!finished) {
select = prompt("I am thinking of one of these colors\n\n brown,cyan,yellow,red,blue,green,black,white,purple,pink\n what color am i thinking of");
finished = check_guess();
}
function check_guess() {
if (select == target) {
return true;
} else {
return false;
}
}
do_gamefunctiononclickattributes? Please add that code in your question too. Or did you type code in the dev tools?