Promptles
Programming Basics

Import / Module

intermediate

Definition

A module is one file of code that shares some of its pieces with other files, and an import is the line in another file that brings those pieces in.

In the wild

The date formatter lives in `dates.js`. The receipts file borrows it with `import { formatDate } from "./dates";` instead of writing its own copy.

More from Programming Basics