Kevin Powell - CommunityKP-C
Kevin Powell - Community3y ago
12 replies
Israr

Fetch Confusion

fetch('https://jsonplaceholder.typicode.com/users')
  .then((response) => {
    return response.json();
  })
  .then((data) => {
    console.log(data) 
  })
  .catch((error) => {
    console.log(error);
  });


I am learning JS. My question is when i am getting this object from fetch how do i use it outside fetch

suppose i have to display all the names from the data on the webpage. how do i do that?
Was this page helpful?