【发布时间】:2016-06-27 11:43:44
【问题描述】:
您好,我有一个使用 JSON.Stringify 输出到此的对象
{"0":["test1","ttttt","","","","","","","",""],"1":["test2","ghjgjhgjh","","","","","","","",""]}
我想要这样的输出。
[["test1","ttttt","","","","","","","",""],["test2","ghjgjhgjh","","","","","","","",""]]
我已经尝试使用 .map 删除“0”和“1”
var itemjson = $.map(cleanedGridData, function (n) {
return n;
});
然而,这给出了(下面)的输出,它已经变平了。
["test1", "ttttt", "", "", "", "", "", "", "", "", "test2", "ghjgjhgjh", "", "", "", "", "", "", "", ""]
【问题讨论】:
标签: javascript object dictionary flatten