js get all value of json object code example
Example 1: how to get all json object with jsonpath
i would put just empty string ""
JsonObject -->> ""
Example 2: get all keys in json object
var obj = {name: "Jeeva", age: "22", gender: "Male"}
console.log(Object.keys(obj))
Example 3: json traversal in js
Object.entries(jsonObj).forEach(([key, value]) => {
});
Example 4: json traversal in js
function traverse(jsonObj) {
if( jsonObj !== null && typeof jsonObj == "object" ) {
Object.entries(jsonObj).forEach(([key, value]) => {
traverse(value);
});
}
else {
}
}