【发布时间】:2021-09-01 14:55:25
【问题描述】:
let newJson = {};
({
"foo": {
"name": newJson.FirstName,
"height": newJson.RealHeight
}
} =
{
"foo": {
"name": "Felipe",
"height": "55"
}
});
console.log({newJson})
如我们所知,上面的代码将在 JS 中返回以下输出:
{newJson :{FirstName: "Felipe", RealHeight: "55"}}
我想知道在 PYTHON 中是否有一个 Lib 或一种方法
【问题讨论】:
-
查看
json标准库。查找文档here -
您的意思是“破坏性”,而不是“破坏性”。
标签: javascript python object destruction