Wrapping Up
JavaScript now provides an effective way to split functions and classes into files or modules. Modules are essential to manage the complexity of large applications and to keep code cohesive and make it easier to reuse. Code within modules run in strict mode. You can be very deliberate about what’s internal to a module and what should be exported. JavaScript offers a variety of options to import classes, functions, variables, and primitives from modules.
In the next chapter we’ll look at promises and the new asynchronous programming features of JavaScript.
Exercises
The imports and exports have some moving parts that can get a bit challenging. Use these exercises to hone in on your understanding. You can find answers to these exercises ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access