MODULE - Glowing Neon Sign on stonework wall - 3D rendered royalty free stock illustration.  Can be used for online banner ads and direct mailers.

Importing a Module

To use a module that has the “export” keyword, we have to import it into our code. To do this we use the “import” keyword…

import { Animal } from ‘./animal.js’; 

This is placed at the top of the file and makes all of the items that have been exported from the animal.js file available. Notice the from part of the statement. This may change based upon the location of the js file being imported.

Happy Coding!

Clay Hess

Share this post

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on print
Share on email
Skip to content