Task

Invoke an object method where the name of the method to be invoked can be generated at run time.



Related tasks

 Respond to an unknown method call.
 Runtime evaluation


// Kotlin JS version 1.1.4-3
 
class C {
    fun foo() {
        println("foo called")
    }
}
 
fun main(args: Array<String>) {
    val c = C()
    val f = "c.foo"
    js(f)()  // invokes c.foo dynamically
}