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

Monday, December 3, 2012

Codecademy: Codeyear Introducing the switch statement


//sample solution


var myCar = "Toyota";
var result;

switch (myCar) {
   
  case "Ford":
    result = "American brand";
  break;
 
  case "Toyota":
    result = "Japanese brand";
  break;
   
  default:
    result = "I'm not sure what country that car is from";
  break;
}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts