Having trouble writing switch

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);

Thank you for taking the time to respond man, I really appreciate it :slight_smile: Quick question- can I send a predefined variable when calling the function, or do I have to put quotation marks around the data?

Thanks! :slight_smile: