Horje
How to access return value of promise Code Example
How to access return value of promise
const address = fetch("https://jsonplaceholder.typicode.com/users/1")
  .then((response) => response.json())
  .then((user) => {
    return user.address;
  });

const printAddress = async () => {
  const a = await address;
  console.log(a);
};

printAddress();
Source: dev.to




Javascript

Related
clear a div Code Example clear a div Code Example
cannot assign to read only property of object '# object ' Code Example cannot assign to read only property of object '# object ' Code Example
how click button and redirect angular Code Example how click button and redirect angular Code Example
how do i make a link to direct me to a new page when i click on a button in react Code Example how do i make a link to direct me to a new page when i click on a button in react Code Example
get class of object javascript Code Example get class of object javascript Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7