How to use a function references in another javascript file

build-tools
es6
modules

#1

I have a three js function defined in my utils.js file.

in this file i have exported the function rmve like so:

I have an index file that i then want to use this function in. How can i do this.


#2

You can’t use ES6 modules directly in the browser - you’ll have to use some kind of bundler (rollup.js, webpack etc.) to create a single .js file containing all your modules.

Have a read through this article, it gives a good introduction on the topic.