Tristan Blakers
11/03/2020, 1:42 AM@JsName("TestClass")
data class TestClass(val num: Int) {
fun half() = num / 2
}
@JsName("doubleNum")
fun TestClass.doubleNum() = this.num * 2
In the above, I can create instances of TestClass and use the half method, but (perhaps unsurprisingly) the doubleNum() method doesn't exist on the object...Big Chungus
11/03/2020, 8:21 AMBig Chungus
11/03/2020, 8:22 AMTristan Blakers
11/03/2020, 8:49 PM