本人新学javascript,遇到一个难题,尝试了好久都没有成功。所以上来请教下大家。
请问如何将以下结构的json转为二维数组?
代码:
"piclist2": {
"/upload/images/2018-4-17/a1.jpg": {
"width": 1440,
"height": 900
},
"/upload/images/2018-4-17/a2.jpg": {
"width": 960,
"height": 600
},
"/upload/images/2018-4-17/a3.jpg": {
"width": 1920,
"height": 1200
},
"/upload/images/2018-4-17/a4.jpg": {
"width": 960,
"height": 600
}
}
转为
"piclist2":[
["upload/images/2018-4-17/a1.jpg",
"width": 1440,"height": 900
],
["upload/images/2018-4-17/a2.jpg",
"width": 1440,
"height": 900
],
["upload/images/2018-4-17/a3.jpg",
"width": 1440,
"height": 900
],
["upload/images/2018-4-17/a4.jpg",
"width": 1440,
"height": 900
],
]
谢谢大家的指点!
这不是一个合法的数组