Skip to content
This repository has been archived by the owner on Jan 5, 2025. It is now read-only.

Commit

Permalink
JavaScript - ES6 Module system
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawid Grochowski (PGS Software) committed Mar 22, 2018
1 parent d41a9f9 commit 43c9615
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Deployment to [Github pages](https://dgrochowski.github.io/frontend-upskilling/)
- In ES6 you can marked `var` as deprecated
- To declare objects and arrays you should use `const` (as often as possible)
- If you cannot use `const`, use `let`
- `'use strict;'` mode will force you to create better quality code. Use it as often as you can.

# Webpack

Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ <h3>JavaScript</h3>
<li><a href="javascript/17-cookies-storage.html">Cookies, local storage, session storage</a></li>
<li><a href="javascript/18-async.html">Async: timeout, interval, XMLHttpRequest (xhr), ajax, fetch</a></li>
<li><a href="javascript/19-regular-expressions.html">Regular expressions</a></li>
<li><a href="/frontend/javascript/20-es6-module-system.html">ES6 - Module system</a></li>
<li><a href="javascript/21-es6-let-const.html">ES6 - let, const</a></li>
</ul>
</body>
Expand Down
15 changes: 15 additions & 0 deletions docs/javascript/20-es6-module-system.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>JavaScript - ES6 Module system</title>
<!--<script type="module" src="_include/21-export.js"></script>-->
<script>
import a from '_include/21-export';
// console.log (a);
</script>
</head>
<body>
<h3>Check console (right click -> inspect -> console)</h3>
</body>
</html>
18 changes: 18 additions & 0 deletions docs/javascript/_include/21-export.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// function myFunction() {
// return 'something new here';
// }
//
// // exports a function declared earlier
// export { myFunction };
//
// // exports a constant
// export const foo = 'some constant var';
//
// // default export function
// export default function() {}
//
// // default export class
// export default class {}

// default export variable
// export default a = 'default var';

0 comments on commit 43c9615

Please sign in to comment.