我的关闭卷曲括号遇到了错误
我遇到了一个错误,说它期望逗号代替卷发支架,但是当我做什么建议时,我会遇到另一个错误,说它现在无法匹配卷发括号。
if (page === "Goexploring") {
axios
.get(process.env.NATIONAL_PARK_API_URL)
.then((response) => {
console.log(response);
let hikingActivity = [];
response.data.data[0].parks.forEach((parks) => {
let output = "";
hikingActivity.forEach((parks, index) => {
output += `${parks.states}: ${parks.states[activities]}, `;
return parks.states === "TN";
})
console.log(hikingActivity);
state.Goexploring.parks = hikingActivity;
done();
})
.catch((err) => console.log(err));
}
}),
},
});
已经调整了添加逗号,牙套并拔出牙套和逗号的内容,并仍然遇到错误。也许有人会以不同的方式看到它。哈哈
i am getting an error saying it's expecting a comma in place of a curly bracket but when i do what is suggested i get another error saying it can't match the curly braces now.
if (page === "Goexploring") {
axios
.get(process.env.NATIONAL_PARK_API_URL)
.then((response) => {
console.log(response);
let hikingActivity = [];
response.data.data[0].parks.forEach((parks) => {
let output = "";
hikingActivity.forEach((parks, index) => {
output += `${parks.states}: ${parks.states[activities]}, `;
return parks.states === "TN";
})
console.log(hikingActivity);
state.Goexploring.parks = hikingActivity;
done();
})
.catch((err) => console.log(err));
}
}),
},
});
have adjusted things adding commas, braces and taking out braces and commas and still getting an error. maybe someone will see it differently. lol
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这样修复它:
支架对着色器(VSCODE扩展)可以帮助您找到这样的错误。
Fix it like this:
The bracket pair colorizer (vscode extension) can help you for finding the errors like this.
以下是格式正确的代码:
您应该查看的另一件事是
forEach
的使用情况。根据文档 ,forEach
不返回任何内容。您可能不想查看map
例如,如果你想构建一个数组。Here is the correctly formatted code:
Another thing you should have a look at is your usage of
forEach
. As per the docs,forEach
does not return anything. You may wan't to check outmap
if you want to build an array for example.