Sample Video Frame

Created by Zed A. Shaw Updated 2024-12-10 18:57:40
 

31: Modules and import

Originally JavaScript had no concept of "modules" because it lived entirely in the browser. A systems language needs to have modules, so Node.JS added modules through the CommonJS system. This uses the require function to load modules, which you've been using this whole time.

In Exercise 13 you wrote a simple module named geometry.js:

View Source file ex13_geometry.js Only

Previous Lesson Back to Module

Register for Learn JavaScript the Hard Way

Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.