var obj = { \'a\' : \'apple\', \'b\' : \'banana\', \'c\' : \'carrot\' }
If I do a
for(key in obj) { console.log( key + \' has a value
You could push all of the keys/values into a a empty array variable that you created. Then, access the last element in the array using array.length-1.