【发布时间】:2018-02-25 18:29:30
【问题描述】:
我在访问已解析的 Promise 对象属性时遇到问题。
使用 fetch,我有一个 .then 这样做:
.then((response) => console.log(response.json()))
我正在尝试通过这样做来访问响应对象的user 属性:
.then((response) => console.log(response.json().user))
它正在返回undefined
这样做的正确方法是什么?
【问题讨论】:
标签: javascript promise fetch-api