File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 28
28
<!-- <script src="src/fetch.js"></script> -->
29
29
<!-- <script src="src/spread.js"></script> -->
30
30
<!-- <script src="src/destructor.js"></script> -->
31
+ <!-- <script src="src/module.js"></script> -->
31
32
</ body >
32
33
</ html >
Original file line number Diff line number Diff line change
1
+ // This is export of variable.
2
+ export let one = 1 ;
3
+
4
+ // This is export of variables.
5
+ let two = 2 ;
6
+ let three = 3 ;
7
+ export { two , three }
8
+
9
+ // This is export of class.
10
+ export class SomeClass {
11
+ constructor ( someProp ) {
12
+ this . someProp = someProp ;
13
+ }
14
+ }
15
+
16
+ // This is export of class.
17
+ export function someFunc ( ) {
18
+ console . log ( "Some text" ) ;
19
+ }
20
+
21
+ // This is export of class or function in the end of file.
22
+ // export { SomeClass, someFunc }
23
+ // export { SomeClass as MyClass, someFunc as myFunc }
24
+
25
+ // This is import of class or function in the end of file.
26
+ // import { SomeClass, someFunc } from "./file.js"
27
+ // import { SomeClass as MyClass, someFunc as myFunc } from "./file.js"
28
+ // import * as SomeObjects from "./file.js"
29
+
30
+ // This is export of default class.
31
+ export default class NewClass {
32
+ constructor ( someProp ) {
33
+ this . someProp = someProp ;
34
+ }
35
+ }
36
+
37
+ // This is import of default class.
38
+ // import NewClass from "./file.js";
You can’t perform that action at this time.
0 commit comments