Module Exercise code not working as expected


This is on the “implementing-modules-using-es-6-syntax” page. Here’s my code:

/* main.js */

// import the functions here, then uncomment the code below
import {changeText, changeToFunkyColor} from ‘…/modules/dom-functions.js’;

const header = document.getElementById(“header”);

// call changeText here
changeText(header, ‘I did it!’)
setInterval(()=> {

// call changeToFunkyColor() here

}, 200);

Problem is that the import isn’t importing the functions. Can anyone offer any hints why?

You are almost there! Your import statement should be: import { changeText, changeToFunkyColor } from './module.js';


Sorry for the slow response … we were on the highway for 13 hours. Now, back to coding!

1 Like