0
我试图创建一个基于特定数据的动态JSON对象。 Source codeJavascript生成动态json响应
如果我输入以下文本:
here
is
an:example
of:
how:this:works
它产生:
[
"here",
"is",
{
"an": "example"
},
{
"of": ""
},
{
"how": {
"this": "works"
}
}
]
我怎样才能得到它返回如下:(因为FOO的没有价值,推动对象成阵列)
[
"here",
"is",
{
"an": "example"
},
{
"of": [
"how": {
"this": "works"
}
]
}
]