Skip to content

Instantly share code, notes, and snippets.

@roundcorners
Created October 25, 2011 09:21
Show Gist options
  • Save roundcorners/1311996 to your computer and use it in GitHub Desktop.
Save roundcorners/1311996 to your computer and use it in GitHub Desktop.
Return an object's key value based on the position of the key
var getItem = function(obj, i) {
var key, arr = [];
for (key in obj) {
arr.push(obj[key]);
}
return arr[i];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment