I have this json
$ cat a.json
{
"students": [
{
"name": "jack",
"id": "0012"
},
{
"name": "tom",
"id": "0023"
}
]
}
I'd like to generate two variables, such as
names = ["jack", "tom"];
ids=["0012", "0023"];
They are one to one mapped between names
and ids
I read this, but it only works on maps, but my json is nested JSON. how can I get the result?
// this doesn't work with my sample.
let keys = Array.from( myMap.keys() )