// Getting the first index of an object (associative array) var obj = {a: 1, b: 2, c: 3}; Object.keys(obj)[0]; // http://stackoverflow.com/questions/909003/javascript-getting-the-first-index-of-an-object