How to Write a Module in JavaScript – Quick Tip

Share this article

In this Treehouse Quick Tip, teacher Jim Hoskins will show you how to write a simple JavaScript module. Modules are useful in writing JavaScript, because they allow us to write code that is less likely to interfere with other code on our page.

It allows us to selectively expose parts of the code to other programs running on our page. This makes our JavaScript code more resilient and easier to maintain.

Free Workshops

Watch one of our expert, full-length teaching videos. Choose from HTML, CSS or WordPress.

Start Learning

Jim Hoskins

Jim Hoskins is an expert teacher at Treehouse. Twitter: @jimrhoskins


One comment on “How to Write a Module in JavaScript – Quick Tip