Skip to content

Instantly share code, notes, and snippets.

@littlemerman
Created July 26, 2011 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save littlemerman/1107489 to your computer and use it in GitHub Desktop.
Save littlemerman/1107489 to your computer and use it in GitHub Desktop.
Buckets values based on a counter
var a = function(counter, values) {
var i = 0, r;
for (i; i < values.length; i++) {
if (counter % values.length === i) {
r = values[i];
break;
}
}
return r;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment