what many fit proceed initial vigilant an associative array javascript?
i need only initial vigilant (actually, only initial key) off rather infinite associative array javascript. here's i'm doing now (using jquery):
getkey = duty (data) {
var firstkey;
$.each(data, duty (key, val) {
firstkey = key;
relapse false;
});
relapse firstkey;
};
just guessing, nonetheless i'd contend there's got improved (read: some-more efficient) proceed doing this. any suggestions?
update: interjection fitting answers comments! i misplaced javascript 101, wherein spec says you're guaranteed sole method an associative array. it's interesting, though, many browsers exercise way. i'd move arrange array before removing initial key, nonetheless competence destined given case.
Comments
Post a Comment