【发布时间】:2020-08-26 09:58:26
【问题描述】:
let url = 'api url';
const players = [];
fetch(url)
.then(response => response.json())
.then(data => players.push(data.included));
console.log(players);
我正在使用 api 来查看服务器上的玩家。我的输出:
https://imgshare.io/image/NyvUN5
我想显示所有当前玩家的所有名称值。 此数组中的对象数量可以随时不同。
【问题讨论】:
-
imgshare.io - 没办法。
-
你能在这里添加实际的输出代码而不是
img吗?
标签: javascript arrays json api object