Importation of JS functions in Kotlin

The first thing to learn about is JavaScript modules. You need to put your Javascript function into a Javascript module. However there are many different module standards in JavaScript. The first thing you should do is learning how to use them.

Search for tutorials describing JavaScript modules. Learn how to use them. Write your own small JavaScript project that imports JavaScript modules.

Once you have learned about JavaScript modules, you can search for Kotlin tutorials that describe how to use and import JavaScript modules into Kotlin code.