export a function code example
Example 1: export function javascript
// export a function in javascript
export function myFunc(var1, var2, ..., varn) {
// do something
}
Example 2: export function javascript
// module "mon-module.js"
export default function cube(x) {
return x * x * x;
}
Example 3: exporting functions
//myfile.js
export function fn1() {...}
export function fn2() {...}
import * as MyFn from blabla
myFn.fn1();