I have an object which was deserialized from JSON:
[Log] {"Rob7":{"lastSeenAt":null,"state":"online","userId":"Rob7"},"Techyudh_rob63":{"lastSeenAt":"2018-07-18T17:45:56Z","state":"offline","userId":"Techyudh_rob63"},"Teacher4":{"lastSeenAt":null,"state":"online","userId":"Teacher4"}} (chat, line 965)
I want to fetch the state of each user from it. I am trying this.
var j = (JSON.stringify(val.presenceStore.store));
var json = $.parseJSON(j);
$(json).each(function(i, val) {
$.each(val, function(k, v) {
console.log(k + " : " + v);
});
});
However, it shows, Rob7: [object Object]
. I am new with JSON. Can anyone please help?