Skip to content

Instantly share code, notes, and snippets.

@chischaschos
Created July 11, 2011 19:50
Show Gist options
  • Save chischaschos/1076649 to your computer and use it in GitHub Desktop.
Save chischaschos/1076649 to your computer and use it in GitHub Desktop.
var ranges = {
'cero': [0, 0],
'white': [1, 21],
'red': [22, 100]};
var value = 11;
for (x in ranges) {
if (value >= ranges[x][0] && value <= ranges[x][1]) {
console.log(x)
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment