Skip to content

Instantly share code, notes, and snippets.

@JoeChapman
Forked from roundcorners/getItem.js
Created February 8, 2012 09:09
Show Gist options
  • Save JoeChapman/1767028 to your computer and use it in GitHub Desktop.
Save JoeChapman/1767028 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