I need help in fetching values from a response object in an ajax call
Code Snippet
$.each(responseJson.slice(0,7), function (index) {
var resp_JSON=responseJson[index];
console.log(resp_JSON);
In console the resp_JSON is Object {17130003: "A message string from the cache"}
Now the response Json doesn't has a name tag so that I can do resp_JSON.id or something & get the value. It just has values.
I tried
resp_JSON[0]; //Error
resp_JSON.Object[0]; //Error
I need to fetch 17130003 & A message string from the cache in two separate javascript variables.
resp_JSON['17130003'], if the keys are dynamic you can useObject.values(resp_JSON)andObject.keys(resp_JSON)