Created
October 25, 2011 09:21
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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