-
-
Save ilearnjavascript/9f3b7b1aa6e4badcc5694477be939584 to your computer and use it in GitHub Desktop.
es6 - modules - 5.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// default import | |
import defaultModule from './modules.js'; | |
// named import | |
import { module1, module2, module3 } from './modules.js'; | |
document.body.insertAdjacentHTML('beforeend', '<div>' + defaultModule + '</div>'); | |
document.body.insertAdjacentHTML('beforeend', '<div>' + module1 + '</div>'); | |
document.body.insertAdjacentHTML('beforeend', '<div>' + module2 + '</div>'); | |
document.body.insertAdjacentHTML('beforeend', '<div>' + module3 + '</div>'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment