-
Notifications
You must be signed in to change notification settings - Fork 0
Home
GBCreation edited this page Oct 11, 2016
·
8 revisions
// module.js
export var foo;
// main.js
import {foo} from './module.js';
console.log(foo);
Result:
undefined
// module.js
export var foo = 1;
export var bar = 1.0;
// main.js
import {foo, bar} from './module.js';
console.log(foo, bar);
Result:
1 1.1
// module.js
export var all = "World";
export var greeter = `Hello ${all}!`; // template string
// main.js
import {all, greeter} from './module.js';
console.log(all, greeter);
Result:
World Hello World!