Help a newbie to solve the following problem. I have an object:
var arr = [
[{a:1},{a:2}],
[{b:1},{b:2}]
];
How to convert it to this:
var arr1 = [
[{a:1},{b:1}],
[{a:2},{b:2}],
];
Many thanks to all for your answers! I'm trying to split the json response from the server to the individual objects. I have here a json: var src = {
img: [
{
alt: "",
src: "http://1.jpg",
width: "125"
},
{
alt: "",
src: "http://2.jpg",
width: "125"
}
],
a: [
{
href: "http://1.html",
content: "title1"
},
{
href: "http://2.html",
content: "title2"
}
],
dd: [
{
p: "content1"
},
{
p: "content2"
}
]
}
I want to convert the json individual objects:
var src1 = [
{
alt: "",
src: "http://1.jpg",
width: "125",
href: "http://1.html",
content: "title1",
p: "content1"
},
{
alt: "",
src: "http://2.jpg",
width: "125",
href: "http://2.html",
content: "title2",
p: "content2"
},
]