如何将平面javascript数组转换为嵌套图结构?
|
我将如何转换此平面json结构:
[
[\"a\",\"b\",\"c\"],
[\"a\",\"b\",\"d\"],
[\"c\",\"b\",\"e\"],
[\"c\",\"b\",\"f\"]
]
使用javascript进入以下图形结构?
{\"uri\": \"a\", \"subItems\": [
{\"uri\": \"b\", \"subItems\": [
{\"uri\": \"c\", \"subItems\": [
{\"uri\": \"b\", \"subItems\": [
{\"uri\": \"e\"},
{\"uri\": \"f\"}
]}
]},
{\"uri\": \"d\"}
]}
]}
没有找到相关结果
已邀请:
2 个回复
公藕
骇毖煽洁铂