Slide 1

Slide 1 text

Oliver Mensah linkedin.com/in/olivermensah/ twitter.com/Oliver_Mensah facebook.com/olivermensah.me omensah.github.io/resume Thinking in Modules in JavaScript

Slide 2

Slide 2 text

Code Dependencies

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Global Pollution Overridden in some instances Inferenc e from our Code

Slide 6

Slide 6 text

Rewriting our JS Code

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Hoisting Why? All Declarations become undefned at the top level Eg. var list // undefned Later each declaration gets assign to its value Eg. list = ['Brendan Eich', 'Douglas Crockford', 'Kent C. Dodds'] Oh! There is another declaration called list Eg. list = ['Passion to Learn’, 'Reading of Source Code as Hobby', 'Computing Concerns' ]

Slide 10

Slide 10 text

Modularizing Our Code

Slide 11

Slide 11 text

Organize Code Visibility Reasons

Slide 12

Slide 12 text

Object Literal IIFE Module Patterns Basic Module Common.js AMD ES6 Modules Revealing Module

Slide 13

Slide 13 text

Object Literal

Slide 14

Slide 14 text

Immediat ely Invoked Function Expressio n (IIFE)

Slide 15

Slide 15 text

Basic Module

Slide 16

Slide 16 text

Revealing Module

Slide 17

Slide 17 text

Common.j s

Slide 18

Slide 18 text

Asynchrono us Module Defnition (AMD)

Slide 19

Slide 19 text

ES6 Modules (Native JS Feature)

Slide 20

Slide 20 text

ES6 Module Backward Compatibility There Come Bundling and Transpiling Tools

Slide 21

Slide 21 text

Webpack Babel Toolings For ES6 Module System

Slide 22

Slide 22 text

Demos Link to Resources: https://goo.gl/ FTwJyQ

Slide 23

Slide 23 text

“Writing Good JavaScript Code is not too much harder, but Writing Bad code is very easier”

Slide 24

Slide 24 text

Thank You

Slide 25

Slide 25 text

Questions