I have a JSON like below (which is basically constructed out of a Dictionary):
{
"test1":["a","b","c"],
"test2":["c","d"],
"test3":["f"]
}
And I want to parse and format above like this:
[
{
"user": "test1",
"cmd": ["a","b","c"]
}
{
"user": "test2",
"cmd": ["c","d"]
},
{
"user": "test3",
"cmd": ["f"]
}
]
Any suggestions on how to do this using JavaScript?