我如何提取或从承诺中保存数据
人们请帮助我。 我有一个对象,我需要从JSON文件中添加一些数据。
let data = {
'test1':1,
'test2:2
}
function convert(){
fetch("./test.json")
.then(response => {
return response.json();
})
.then(jsondata => {
{data = {...data, ...jsondata}}
console.log(data)
});
}
console.log(data)
为了保存新版本数据,我必须做什么?
people please help me with this.
I have an object, and I need to add some data to this object from json file.
let data = {
'test1':1,
'test2:2
}
function convert(){
fetch("./test.json")
.then(response => {
return response.json();
})
.then(jsondata => {
{data = {...data, ...jsondata}}
console.log(data)
});
}
console.log(data)
What I must to do in order to save new version data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就您而言,您只需要这样做:
而不是这样:
In your case, you just need to do this:
instead of this: