xxxxxxxxxx
myObject = {
"key": "value"
}
Object.keys(myObject); // get array of keys
xxxxxxxxxx
Object.keys(jsonData).forEach(function(key) {
var value = jsonData[key];
// ...
});
xxxxxxxxxx
var obj = {"success":"You are welcome"};
var keys = Object.keys(obj);
console.log(keys[0]);
Run code snippetHide results
xxxxxxxxxx
Object.keys(jsonData).forEach(function(key) {
var value = jsonData[key];
// ...
});