johnfn
02/17/2020, 10:07 PMobject { val x = 1 }
and then i want to make a list of them, how would i write it? ideally, something that i could put in ???
class Foo {
private val myList = mutableListOf<???>()
private fun addItem(x: Int) =
myList.add(
object { val x = x }
)
}
Shawn
02/17/2020, 11:01 PMAny
Any
like everything does by defaultx
valMap
Chenn
02/18/2020, 8:25 AMval obj = js("{}")
obj["type"] = type
This is how I put a key - value pair in an anonymous object in kotlin. Maybe it helps.val obj: dynamic = object{}
reducers.forEach { obj[it.key] = it.value}
This practically generates the same code..Shawn
02/18/2020, 3:59 PMjs()
isn’t a stdlib function and dynamic
isn’t a standard type on JVM, and presumably elsewhereChenn
02/18/2020, 4:01 PM