File tree 1 file changed +13
-1
lines changed
1-js/10-modules/01-modules-intro 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*/!*
305
305
sayHi(); // Ready to serve, *!*Pete*/!*!
306
306
` ` `
307
307
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
+
308
318
### Top- level " this" is undefined
309
319
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:
311
323
312
324
```html run height=0
313
325
<script>
You can’t perform that action at this time.
0 commit comments