Horje
async promise javascript Code Example
async awiat
const data = async ()  => {
  const got = await fetch('https://jsonplaceholder.typicode.com/todos/1');
  
  console.log(await got.json())
}

data();
promise async await
async function myFetch() {
  let response = await fetch('coffee.jpg');
  if (!response.ok) {
    throw new Error(`HTTP error! status: ${response.status}`);
  }
  return await response.blob();

}

myFetch().then((blob) => {
  let objectURL = URL.createObjectURL(blob);
  let image = document.createElement('img');
  image.src = objectURL;
  document.body.appendChild(image);
}).catch(e => console.log(e));
async promise javascript
await new Promise(resolve => setTimeout(resolve, 1000))




Javascript

Related
on click a button triger a tab bootstrap 5 Code Example on click a button triger a tab bootstrap 5 Code Example
Admobs For Ios Code Example Admobs For Ios Code Example
how to delete props from url Code Example how to delete props from url Code Example
parsley custom error message Code Example parsley custom error message Code Example
jackson jsonpath Code Example jackson jsonpath Code Example

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