javascript import file code example
Example 1: alias import javascript
import {default as alias} from 'my-module';
Example 2: include other js files in a js file
document.writeln("<script type='text/javascript' src='Script1.js'></script>");
document.writeln("<script type='text/javascript' src='Script2.js'></script>");
Example 3: javascript using another js file
export function hello() {
return "Hello";
}
import {hello} from 'module';
let val = hello();
Example 4: javascript import
import { module } from "./path";
import Module from "./path";
import Module, { module } from "./path";
Example 5: import all from javascript
import * as module from "./module.js";
Example 6: how to call a script from another script in javascript
<script type="text/javascript" src="file1.js"></script>
<script type="text/javascript" src="file2.js"></script>
<script type="text/javascript">
alertOne( );
</script>