-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path19-Module.js
More file actions
23 lines (20 loc) · 700 Bytes
/
Copy path19-Module.js
File metadata and controls
23 lines (20 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* Module: to seperate a related portions of the code, or gathering of related items togheter and can access it through module.
* ES6 adds first-class syntax support for the concept of modules. When loaded via the module system, ES6 treats a file as a separate module.
* Each module can both import other modules or specific API members, as well export their own public API members
* */
// Example:
// login.js
function hello(who) {
return who +" is logging into system";
}
export hello;
//welcome.js
// import only `hello()` from the "login" module
import hello from "login";
var hungry = "Said Shah Ahmadi";
function awesome() {
console.log(
hello( hungry ).toUpperCase()
);
}