1 // some 3rd party library
2 export function merge() {...};
3 export function filter() {...};
4 export function map() {...};
5
6 // your app
7
8 import { filter } from 'third-party';
Slide 38
Slide 38 text
1 // final bundle
2 function filter() {...};
3 ...your app code...
Slide 39
Slide 39 text
const and let
Slide 40
Slide 40 text
scope
Slide 41
Slide 41 text
window (global) scope
function scope
Slide 42
Slide 42 text
foo = 2
bar = 3
x = fn
baz = 4
1 var foo = 2;
2
3 function x() {
4 bar = 3;
5 var baz = 4;
6 }
Slide 43
Slide 43 text
x
foo = 1
bar = 2
1 function x() {
2 var bar = 2;
3 if (...) {
4 var foo = 1;
5 }
6 }
Slide 44
Slide 44 text
window (global) scope
function scope
block scope
let
const
Slide 45
Slide 45 text
x
bar = 2
foo = 1
baz = 3
1 function x() {
2 var bar = 2;
3 if (...) {
4 let foo = 1;
5 const baz = 3;
6 }
7 }