import script js code example
Example 1: javascript using another js file
export function hello() {
return "Hello";
}
import {hello} from 'module';
let val = hello();
Example 2: javascript import
import { module } from "./path";
import Module from "./path";
import Module, { module } from "./path";
Example 3: import javascript
import { add } from './math_functions.js';
import { add, someothervariable } from './math_functions.js';
Example 4: javascript import
"type": "module",
import { module } from "./path";
Example 5: How to add js file to a site through url
var jsFile = document.createElement("script");
jsFile.src = "homePage.js";
document.body.appendChild(jsFile);