Skip to content

Instantly share code, notes, and snippets.

Created March 25, 2020 04:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
ES6 modules basic demo for
<!doctype html>
<html lang="en">
<meta charset="utf-8">
ES6 modules demo
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="script.js"></script>
<main id="main" role="main" class="content">
ES6 modules demo
Open browser console.
</main><!-- /.content -->
// Vychozi export:
export default function() {
console.log('Default function')
// Export konsstanty:
export const hello = 'Hello!'
// Export funkce:
export function foo() {
// Funkce, ktera neni exportovana a zvenci je nedostupna:
function bar() {
// Importujeme:
import * as module from './module.js';
// Pouzivame:;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment