Answer the question
In order to leave comments, you need to log in
How to detect error in json?
For example, json (taken from the documentation https://github.com/d3/d3-dsv )
[{"foo": "1", "bar": "2"}, columns: ["foo", "bar"]]
, columns: ["foo", "bar"]
Answer the question
In order to leave comments, you need to log in
This is not valid JSON - as JSON, no one will use this comment from the documentation. But the comment gives an idea of the structure that the described method returns.
The returned array also exposes a columns
property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary).
var a = [11,22];
a.columns = [333, 444];
JSON.stringify(a)
> "[11,22]"
JSON.stringify(a.columns)
"[333,444]"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question