I have a generic JSON structure I want to put in to a JavaScript object.
My JSON is like this
{
"rows": [
{
"items": [
{
"key": "foo1",
"value": "bar1"
} ,
{
"key": "foo2",
"value": "bar2"
}
]
}
] }
What is the easiest way to convert this in to a JS object like this:
Item.foo1 = 'bar1';
Item.foo2 = 'bar2';
I can use something like JSONPath But I thought maybe there is a simpler way to do this? using straight JavaScript?