[Code Demo] What is Top Level Await | JSer - Front-End lover
757 بار بازدید -
3 سال پیش
-
You can think of JavaScript
You can think of JavaScript module as a big async function, and `import` act as implicit `await`.
So when module is `imported`, the top-level await inside it will be respected, allow you to do some async work but behaves like sync module for others.
here is the demo link: https://codesandbox.io/s/js-module-ml57h
Hi I'm a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode & BFE.dev. If you are interested, maybe we can learn together.
So when module is `imported`, the top-level await inside it will be respected, allow you to do some async work but behaves like sync module for others.
here is the demo link: https://codesandbox.io/s/js-module-ml57h
Hi I'm a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode & BFE.dev. If you are interested, maybe we can learn together.
3 سال پیش
در تاریخ 1400/01/06 منتشر شده
است.
757
بـار بازدید شده