In R , we have the handy function str
to inspect object that tells you the structure of an object.
Here an example used to get the structure of a parsed json
object ( I am using json
just to give a useful example)
txt = '{"name":"agstudy","job":"developer"}'
library(rjson)
obj = fromJSON(txt)
Now using str
:
str(obj)
List of 2
$ name: chr "agstudy"
$ job : chr "developer"
Now using jquery
for example I can do this for example:
txt = '{"name":"agstudy","job":"developer"}';
var obj = $.parseJSON(txt);
var x = '';
$.each(obj, function(key, val) {
x = x + ' key ' + key + ' val ' + val +'\n'
});
But I am looking for more handy function?