Json.set所在位置是kotlin.js.Json.set,其相关用法介绍如下。

用法:

abstract operator fun set(propertyName: String, value: Any?)

该函数的调用将被转换为 value 分配给使用 propertyName 索引(使用方括号/索引操作)的接收器。

例如:对于以下代码:

fun test(j: Json, p: String, newValue: Any) {
    j["prop"] = 1
    j.set(p, newValue)
}

将生成:

function test(j, p, newValue) {
    j["prop"] = 1;
    j[p] = newValue;
}
}