diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-03-02 21:02:47 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-03-02 15:02:47 -0500 |
commit | 39ed9759113bc6cd3746020b611e1b6833b53f1a (patch) | |
tree | 2dfddec9708093a650a0a7aa4aa8b7918baa1380 | |
parent | bf95acf3eb5a4cf31d63cb228979d967467e7743 (diff) |
manual - import.meta.main (#1868)
-rw-r--r-- | website/manual.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/website/manual.md b/website/manual.md index f250a00ee..cda4f6120 100644 --- a/website/manual.md +++ b/website/manual.md @@ -472,11 +472,11 @@ software, centralized code repositories, and superfluous file formats. ### Testing if current file is the main program -By using `window.location` and `import.meta.url` one can test if the current -script has been executed as the main input to the program. +To test if the current script has been executed as the main input to the program +check `import.meta.main`. ```ts -if (window.location.toString() == import.meta.url) { +if (import.meta.main) { console.log("main"); } ``` |