Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

getdata from fetch api into variable

async function getData(url) {
  const response = await fetch(url);

  return response.json();
}

const data = await getData(url);

console.log({ data })
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #getdata #fetch #api #variable
ADD COMMENT
Topic
Name
7+3 =