我是node.JS的新手,目前正在开发一个小型项目。 问题陈述:我想获取“窗口”的值,但想要隐藏“窗口”键。 Node.js中有这种方法吗?Node.js中的JSON对象内的JSON对象
输入JSON:
{
"widget": {
"debug": {
"window": {
"image": [
{
"src": "Images/Sun.png",
"name": "sun1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
},
{
"src": "Images/Moon.png",
"name": "moon1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
}
]
}
}
}
}
输出JSON:
{
"widget": {
"debug": {
"image": [
{
"src": "Images/Sun.png",
"name": "sun1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
},
{
"src": "Images/Moon.png",
"name": "moon1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
}
]
}
}
}
“hide”是什么意思? –
@Kevin B我不想要“窗口”,即在输出JSON中看到的关键。只有它的值必须被显示。 –
换句话说,您想要移除'widget.debug.window',并在'widget.debug'上存储'widget.debug.window.image'键/值对。 –