import js script in browser code example
Example 1: import modules js html
<script type="module" src="main.js"></script>
Example 2: javascript using another js file
// module.js
export function hello() {
return "Hello";
}
// main.js
import {hello} from 'module'; // or './module'
let val = hello(); // val is "Hello";