freeCodeCamp Challenge Guide: Import a Default Export

Import a Default Export

Importing an export default is almost the same as importing a normal export; you just don’t need the curly braces to define the name of what you’re importing from the file!


Hints

Hint 1

Fill in the blanks: import _ from "file-name". Plug in your module’s name (which is subtract) into _, and put "math-functions" into "file-name".


Solutions

Solution 1 (Click to Show/Hide)
import subtract from "./math_functions.js";
// add code above this line

subtract(7,4);
8 Likes