{ case “rabbit”: alert(“Watch out, it’s Elmer Fudd!”) break; case “coyote”: alert(“No match for the road runner - meep meep!”) break; case “mouse”: alert(“Watch out Jerry, here comes Tom!”) break; default : alert(“Are you sure you picked an animal from a cartoon?”); } } Looping while A loop while (condition) { code to be executed } < script type=”text/JavaScript” > i = 1 while (i < 11) { document.write(i + x 3 = + (i * 3) + < br / > ); “ “ “ ” i ++ } < /script > do while A loop do { code to be executed } while (condition) < script type=”text/JavaScript” > i = 12 do { document.write(i + x 3 = + (i * 3) + < br / > ); “ “ “ ” i ++ } while (i < 11) < /script > for A loop for (a; b; c) { code to be executed } for (i=0; i < 11; i++) { document.write(i + x 3 = + (i * 3) + < br / > ); “ “ “ ” }
{ case “rabbit”: alert(“Watch out, it’s Elmer Fudd!”) break; case “coyote”: alert(“No match for the road runner - meep meep!”) break; case “mouse”: alert(“Watch out Jerry, here comes Tom!”) break; default : alert(“Are you sure you picked an animal from a cartoon?”); } } Looping A while loop while (condition) { code to be executed } < script type=”text/JavaScript” > i = 1 while (i < 11) { document.write(i + “ x 3 = “ + (i * 3) + “ < br / > ” ); i ++ } < /script > A do while loop do { code to be executed } while (condition) < script type=”text/JavaScript” > i = 12 do { document.write(i + “ x 3 = “ + (i * 3) + “ < br / > ” ); i ++ } while (i < 11) < /script > A for loop for (a; b; c) { code to be executed } for (i=0; i < 11; i++) { document.write(i + “ x 3 = “ + (i * 3) + “ < br / > ” ); }