javascript - how to get the entire content of a JSON file in the console.log -
i have kind of weird question.
my json looks this:
var content = '{"content":[' + '{"value1": "0", "value2": "0", "value3": "20", "value4": "40", "value5": "string" },' + ... '{"value1": "0", "value2": "0", "value3": "20", "value4": "40", "value5": "string" }]}';
i wondering how content of json file "as is" displayed in console.log();
? want exact json file.
when
var obj = json.parse(content); console.log(obj);
or
var obj = json.parse(content); console.log(obj.content);
i this
[object object]
is there obj.all()
or something?
you don't parse json logged.
a
json
is string.
so only
console.log(content);
Comments
Post a Comment