Obtenha todas as chaves no objeto JSON
var obj = {name: "Jeeva", age: "22", gender: "Male"}
console.log(Object.keys(obj))
Powerful Porpoise
var obj = {name: "Jeeva", age: "22", gender: "Male"}
console.log(Object.keys(obj))
var jsonData = {person:"me", age :"30"};
console.log(Object.keys(jsonData)[0])
// Prints person
myObject = {
"key": "value"
}
Object.keys(myObject); // get array of keys