Q: is there a way to list the properties of a Java...
# javascript
n
Q: is there a way to list the properties of a JavaScript object in Kotlin? I want to process all properties of a parsed JSON object, but cannot work out how to do it.
k
Copy code
class A {
    val x = 23
    val y = "foo"
}

external class Object {
    companion object {
    	fun keys(o: Any?): Array<out String>
    }
}

fun main(args: Array<String>) {
    println(Object.keys(A()))
}