April 2018
Intermediate to advanced
284 pages
5h 46m
English
| Tip 47 | Isolate Functionality with Import and Export |
In this tip, you’ll learn how to share code between files.
In the bad old days of JavaScript, you kept all code in a single file. Even worse, developers would put all their JavaScript code in the DOM under a single <script> tag.
Things got better slowly. First, someone created code to minify and concatenate files so at least you had only one small import statement. Then projects such as Require.js and CommonJS gave developers a way to share code between files using modules. With the module system, JavaScript developers were finally able to easily reuse code in a project.
Modules have been simplified and are now simple import and export statements. And with this simple interface, not only ...
Read now
Unlock full access