how can I create a new instance of a JS class and ...
# javascript
b
how can I create a new instance of a JS class and pass constructor parameters to that? Got it: Reflect.construct(clazz, arrayOf(param1))
Copy code
fun <T: Any> JsClass<T>.newInstance(parameters: ReadonlyArray<Any?>) =
    Reflect.construct(this, parameters)
Edit: https://github.com/JetBrains/kotlin-wrappers/pull/2399
t
b
sorry for the many questions 🙂
t
@Bernhard Thank you for implementation! 😉
sorry for the many questions 🙂
Don't stop! 😜
b
to a degree it felt like rocket science
t
It's only first stage 🧌