如何在 JSON 中获取带有 0 的 API

How to fetch API with a 0 in the JSON

我正在尝试在 React.JS 中获取包含不同数据的 API。但是我无法获取任何包含数字的内容。

例如,我可以通过 data.main.temp 获取 API 中的温度,或者通过 data.main.humidity 获取湿度。我怎样才能对天气做同样的事情。0.description,因为我得到了错误。

这将达到目的weather[0].description(获取与数组第 0 个索引相关的值)

使用weather[0].idweather[0].main