File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
1-js/10-modules/01-modules-intro Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -305,9 +305,21 @@ alert(admin.name); // *!*Pete*/!*
305305sayHi(); // Ready to serve, *!*Pete*/!*!
306306` ` `
307307
308+ ### import .meta
309+
310+ The object ` import.meta` contains the information about the current module .
311+
312+ Its content depends on the environment, in a browser it contains the url of the script, or a webpage if inside HTML
313+
314+ ` ` `
315+ alert(import.meta.url); // the url of the current page (or the script URL)
316+ ` ` `
317+
308318### Top- level " this" is undefined
309319
310- In a module , top- level ` this` is undefined (as opposed to a global object in non- module scripts):
320+ That' s kind of a minor feature, but for completeness we should mention it.
321+
322+ In a module, top-level `this` is undefined, as opposed to a global object in non-module scripts:
311323
312324```html run height=0
313325<script>
You can’t perform that action at this time.
0 commit comments