Thursday, April 18, 2013

Javascript: The Switch Statement

a total of 10 bucks

The 'switch' statement is so freaking cool. Excuse the lameness and feel free to replace all the bolded words with whatever you want! Hahaha :)

var outfit = prompt("What do you think would look good with this maxi skirt?","Enter text here");

switch(outfit){
    case 'crop top':
        console.log("Totally agree with you, girl.");
        break;
    case 'flatforms':
        console.log("You like flatforms? Same here!");
        break;
    case 'concho belt':
        console.log("Such a fab accessory, especially for summer!");
        break;
    case 'uggs':
        console.log("Girl, how many times have I told you... don't ever wear those... those things!");
        break;
    default:
        console.log("Huh.... are you sure about " + outfit + " ? How about a crop top?");
}

No comments:

Post a Comment