Created
June 30, 2025 20:53
-
-
Save James-E-A/ed7e346bf57011a55b07bbe782dc5271 to your computer and use it in GitHub Desktop.
Javascript currentScript async
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript">(async () => { | |
const currentScript = document.currentScript; // scoped to this IIFE, does not pollute global namespace or vanish on future event loop ticks | |
// You are 100% free to do async stuff in this block | |
console.info(await 42); | |
// ... // | |
})().then((value) => {if (value) !== undefined console.debug(value);});</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment