let url = 'https://jsonplaceholder.typicode.com/users',
usersID = []
async function getUsers(url) {
let response = await fetch(url),
result = await response.json()
console.log(Array.isArray(result));
for (const key in result) {
if (result.hasOwnProperty(key)) {
const obj = result[key];
}
}
}
getUsers(url)
let url = 'https://jsonplaceholder.typicode.com/users';
async function getUsers(url) {
const response = await fetch(url)
const result = await response.json()
const usersID = result.reduce((acc, item) => {
const { id } = item;
acc.push(['id', id])
return acc
}, [])
console.log(usersID)
}
getUsers(url)