37
rated 0 times
[
41]
[
4]
/ answers: 1 / hits: 18087
/ 8 Years ago, sun, july 24, 2016, 12:00:00
It is my first time using the switch
statement in Javascript. Is there a way to evaluate multiple conditions one switch statement, like so:
var i = 1;
switch(i && random(1)<0.3) {
case (1):
//code block
break;
case (2):
//code block
}
So that the code blocks would execute if both of the conditions were true?
More From » switch-statement