Return to Snippet

Revision: 4273
at November 18, 2007 10:58 by 1man


Initial Code
function switchTest(x){
	switch(x){
		case 1:
			console.log("x equals 1");
			return x;
		case 2:
			console.log("x equals 2");
			return x;
		case 3:
			console.log("x equals 3");
			return x;
		default:
			console.log("x doesn't equal 1 to 3");
			return x;
	}
}

Initial URL

                                

Initial Description
Very basic switch statement.

Initial Title
Simple Switch Statement

Initial Tags

                                

Initial Language
JavaScript