Skip to content

Instantly share code, notes, and snippets.

@ovargas27
Created July 11, 2011 18:12
Show Gist options
  • Save ovargas27/1076417 to your computer and use it in GitHub Desktop.
Save ovargas27/1076417 to your computer and use it in GitHub Desktop.
Swith in js
function updateShadowColorValues(value){
var eye_color = "none";
switch (true) // << compare true with case value
{
case (value == 0):
eye_color = "cero [" + value + "]";
break;
case (value > 0 && value < 21):
eye_color = "white [" + value + "]";
break;
default:
eye_color = "fail [" + value + "]";
}
return eye_color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment