-2

本人新学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
           ],
        ]

谢谢大家的指点!

debuger 10
2018-04-21 提问

查看全部 4 个回答

0

数组对象傻傻分不清楚

你这不是数组

clipboard.png

推广链接