how to use import in js code example
Example 1: alias import javascript
import {default as alias} from 'my-module';
Example 2: js import and export
export function helloWorld() {
return 'Hello World!';
}
import helloWorld from './helloworld.js';
console.log(helloWorld());
Example 3: javascript import
import { module } from "./path";
import Module from "./path";
import Module, { module } from "./path";
Example 4: import javascript
import { add } from './math_functions.js';
import { add, someothervariable } from './math_functions.js';