Module Scope

Introduction to module scope in JavaScript.

Background

In this lesson, we will start by defining a module and then learn scope in terms of modules.

Introduction

Modules are files of JavaScript code. They usually contain a class or library of functions for a specific task. These modules break our programs down into smaller parts, making it easier to manage. The illustration below outlines how to break a large file of code into modular chunks.

Get hands-on with 1200+ tech skills courses.