function

fun JsObject.function(name: String, arity: Int = 0, flags: PropertyFlags = PropertyFlags(enumerable = false), body: (List<JsValue>) -> Any?): JsFunction

A host function that takes the arguments as they came.


inline fun <A, R> JsObject.function(name: String, crossinline body: (A) -> R): JsFunction

A one-argument host function, with the argument and the answer converted for you.


inline fun <A, B, R> JsObject.function(name: String, crossinline body: (A, B) -> R): JsFunction

A two-argument host function.


inline fun <A, B, C, R> JsObject.function(name: String, crossinline body: (A, B, C) -> R): JsFunction

A three-argument host function.