https://kotlinlang.org logo
b

BearDev

04/29/2019, 7:47 PM
Hello, I trying to figure out the proper way to call js object constructors from kotlinjs. I found this solution, but it seems rather hacky https://discuss.kotlinlang.org/t/is-there-a-way-to-use-the-new-operator-with-arguments-on-a-dynamic-variable-in-kotlin-javascript/6126
Copy code
fun newSomething(a: dynamic, b: dynamic, c: dynamic): dynamic{
     return js(“new window.classNameK(a,b,c)”)
}
Is there a better way or should I stick to the above method?