Advertisement
whoisYeshua

Promise Order 3

Jun 15th, 2023
686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const createPromise = () => Promise.resolve(1)
  2.  
  3. function func1() {
  4.   createPromise().then(console.log)
  5.   console.log(2)
  6. }
  7.  
  8. async function func2() {
  9.   await createPromise()
  10.   console.log(3)
  11. }
  12.  
  13. console.log(4)
  14. func1()
  15. func2()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement