codecademy javascript tutorial - module

in javascript •  6 years ago 

I'll modify this post with my comment!

INTERMEDIATE JAVASCRIPT MODULES
Review
We just learned how to use JavaScript modules. Let's review what we learned:
Modules in JavaScript are reusable pieces of code that can be exported from one program and imported for use in another program.
• module.exports exports the module for use in another program.
• require() imports the module for use in the current program.
ES6 introduced a more flexible, easier syntax to export modules:
• default exports use export default to export JavaScript objects, functions, and primitive data types.
• named exports use the export keyword to export data in variables.
• named exports can be aliased with the as keyword.
• import is a keyword that imports any object, function, or data type.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!