Hi everyone. I’m working my way through the javascript lessons, but I’m having some trouble understanding how to write switch statements. This is a little different from the challenge thingy, but can you tell me how this is wrong? I’m trying to get my browser to spit out a colour:
function yocolour {
switch (colour) {
case "red":
document.write("red yo");
break;
case "blue":
document.write("blue yo");
break;
case "yellow":
document.write("yellow yo");
}
}
yocolour(red);