Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, December 3, 2012

Codecademy: Codeyear Background to switch statements


//sample solution


var jacketColor = "";
var result;

switch (jacketColor) {
   
  case "black":
    result = "Pay $300";
    break;
   
  case "brown":
    result = "Pay $200";
    break;
   
  case "green":
    result = "Pay $5";
    break;
   
  default:
    result = "This color does not match my eyes!";
}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts