Create an Account
username: password:
 
  MemeStreams Logo

#@x!?ing JavaScript

search

Acidus
Picture of Acidus
My Blog
My Profile
My Audience
My Sources
Send Me a Message

sponsored links

Acidus's topics
Arts
Business
Games
Health and Wellness
Home and Garden
Miscellaneous
Current Events
Recreation
Local Information
Science
Society
Sports
Technology

support us

Get MemeStreams Stuff!


 
#@x!?ing JavaScript
Topic: Technology 5:47 pm EDT, Aug 17, 2007
var c=2;

var x=2;


switch(x) {

    case 1:
        alert("In 1");
        break;
    case c:
        alert("In 2");
        break;

    default:
        alert("default");
}

//displays 2!

In JavaScript you can define case blocks with expressions. ... wow... I mean... just wow.



 
 
Powered By Industrial Memetics
RSS2.0