首页 > 解决方案 > Javascript Fetch 练习题:阅读 NewsApi 对象

问题描述

抱歉,如果这与另一个主题重叠。它可能是相似的。

我正在做第一个从 NewsAPI 中提取 API 数据的 javascript 练习,我正在查看数据。

{status: "ok", totalResults: 10, articles: Array(10)}
articles:Array(10)
 0:
   author: "OptimalBits"
   content: "With built in Cluster..."
   description: "A modern reverse proxy..."
   publishedAt: "2018-11-05T13:08:21.7344616Z"
   source: {id: "hacker-news", name: "Hacker News"}
   title: "OptimalBits/redbird"

我正在尝试访问其中的信息,以便生成一系列主题/描述。

它是什么?目的?对象内的对象(提示 Xzibit meme)?

console.log(data.articles[0].title()) 

返回

不明确的

标签: javascriptjsonfetch

解决方案


推荐阅读