Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

import/export js functions

// helloworld.js

export function helloWorld() {
    return 'Hello World!';
}

// main.js

import helloWorld from './helloworld.js';

console.log(helloWorld());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #functions
ADD COMMENT
Topic
Name
6+7 =