Animations

API

Arrays

Async

Basics

Challenges

Classes

Console

Dates

Debugging

DOM Elements

DOM Methods

DOM Navigation

DOM Properties

Event Listeners

Flow Control

Forms

Functions

Global Functions

JSON

Keywords

Libraries (3rd party)

Math

Modules

Objects

Snippets

String

Types

Widgets

Window Object

JavaScript - Importing

Just as you can export a whole collection of methods, or the entire object, you can import explicit methods or the whole object which was exported.


// js file

// this is a default import.  the exporter must have been marked as 'export default'
// we can name this anything.
import anything from 'myFile.js';

// or
import {method1, method2} from 'myFile.js';

// or
import * as imported from 'myFile.js';

// or
import anythingFromDefaultExport, {someOtherMethodExportedOnmyFile.js} from 'myFile.js';