May 2018
Intermediate to advanced
376 pages
9h 22m
English
After reading lesson 20, you will
Before you learn how to create and use ES2015 modules, let’s define what a module in JavaScript is. At its most basic, a module is a JavaScript file that has its own scope and rules, and may import or export values to be used by other modules. A module isn’t an object: it has no data type, and you can’t store one in a variable. It’s simply a tool to break apart, encapsulate, and organize your code.
Modules are a great way to separate your logic into cohesive units and share logic across files without the cumbersome use of global variables. They also allow you to import only what’s ...
Read now
Unlock full access