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

[WIP] JavaScript - ES6 Module system #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="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';