Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

async await return promise

async function abc() {
    console.log("1");
    const response = await fetch("https://jsonplaceholder.typicode.com/users");
    console.log("4");
    const users = await response.json();
    console.log("5");
    return users;
  }
  
  const a = abc();
  
  a.then((e) => {
    console.log(e);
  });
  console.log("2");
  console.log(a);
  console.log("3");
Comment

PREVIOUS NEXT
Code Example
Javascript :: check leap year 
Javascript :: for-in loop 
Javascript :: timout 
Javascript :: react component pass props 
Javascript :: electron Uncaught ReferenceError: require is not defined 
Javascript :: how to pause settimeout in javascript 
Javascript :: online convert python to javascript 
Javascript :: how to sort linesin javascript 
Javascript :: oridnal suffix 
Javascript :: js how to get n fibonacci number 
Javascript :: The DOM Parent-Child Relationship 
Javascript :: javascript Implicit Conversion to String 
Javascript :: javascript variable hoisting 
Javascript :: javascript modules 
Javascript :: javascript Nested Destructuring Assignment 
Javascript :: javascript Working of multiple yield Statements 
Javascript :: react destructuring with rename 
Javascript :: jQuery Traversing - Ancestors 
Javascript :: jquery put value in table 
Javascript :: npm function-memoizer 
Javascript :: Elementor Hide Sticky Header on Scroll Down - Show on Scroll Up 
Javascript :: phaser enable pixel art 
Javascript :: mui adding eye toggle at password field 
Javascript :: white when respons show code 
Javascript :: find numeric Unicode value of the character with charCodeAt() method 
Javascript :: Use Prototype To Add A Property To Javascript Class 
Javascript :: javascript prompts user to input 
Javascript :: js filter example 
Javascript :: convert html to javascript 
Javascript :: react check if browser is in dark mode 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =