Skip to content

Tag: json

Json path starting with 0

I’m trying to get the data from a https.get request to an API and the json path has a 0 at the beginning. What does it mean and how do I access the data? The path is 0.length and the json chart viewer throws an error. The data looks like this in json viewer: Answer 0 is index of array,

Creating a nested Json from an array

I have this Js array: How to convert restructure this array to JSON? I tried with the JSON.stringify() function but I don’t get the expected result. Thanks Answer You could use Array.prototype.map to convert sub-array entries of the original array into objects with suitably named properties, and call JS…