I want to access the keys of the the objects in the array.
The example of object is:
var trackobj = {
trackees: [{
john: {
"lat": "120000"
, "long": "12345"
}
, harry: {
"lat": "210000"
, "long": "5433333"
}
, sid: {
"lat": "420000"
, "long": "21345"
}
}]
}
I am using the function:
function searchTrackee() {
for (var i = 0; i <= trackobj.trackees.length; i++) {
console.log(trackobj.trackees[i]['key']);
}
}
The expected output I expect is "john" "harry" "sid".