Advertisement
Guest User

Untitled

a guest
Sep 14th, 2019
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const promiseOfSomeData = fetch("some.json").then(r=>r.json()).then(data => {
  2.     console.log('in async');
  3.     return data;
  4. });
  5. window.onload = async () => {
  6.     let someData = await promiseOfSomeJsonData;
  7.     console.log("onload");
  8. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement