multiple arguments in switch?

J

JS

As I can remember this is not allowed in java:

int x, y, z;

switch(x,y,z){
case 1,2,3:
System.out.println("Hep");
break;
}


But what about in JavaScript, or are there some other kind og syntax for
switch??
 
R

Richard Cornford

JS said:
As I can remember this is not allowed in java:

int x, y, z;

switch(x,y,z){
case 1,2,3:
System.out.println("Hep");
break;
}


But what about in JavaScript,

If the - int - was - var - and the - System.out.println - referred to a
function object then the rest of the syntax is fine in javascript. It is
extremely unlikely that that a list expression used as the Expression
for the - switch - statement, or the Expression for the - case - clause,
will do anything useful.
or are there some other kind
og syntax for switch??

By "some other kind og syntax" do you mean something that will do what
you want to do? That will inevitably depend on what it is you are trying
to do.

The FAQ for this group includes guidance on the asking of questions. You
would benefit form reading it.

<URL: http://www.jibbering.com/faq >

Richard.
 
A

alu

Could i recommend that you download the old-but-still-ever-so-easy-to-read
netscape client-side javascript reference manual?
It will provide the answer to most of your everyday questions within a few
seconds.
ftp://docs-pdf.sun.com/816-6408-10/816-6408-10.pdf

-alu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top