Sample Video Frame
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
:
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.