How to get value from List from javascript side? `...
# javascript
l
How to get value from List from javascript side?
kotlinArray[0]
kotlinArray.get(0)
- not works real method have name
get_za3lpa
I am unable to add operator with @JsName
k
What's wrong with this?
val x = listOf("a", "b") println(x[0])
s
I guess the question is how to call it from javascript code (not Kotlin).
l
Yes
b
@lewik use mangled (real) name —
list.get_za3lpa$(1);
l
No
Jack Sparrow style
Copy code
kotlin.kotlin.collections.ArrayList.prototype.ARR = function () {
    return this.array_hd7ov6$_0
};
In case of change get_za3lpa$
b
@lewik um…, what is wrong with
get_za3lpa$
?
array_hd7ov6$_0
will be changed more likely than
get_za3lpa$
.
l
@bashor Anyway, this is temporary hack. I'm rewriting project to kotlin and then will remove that hacks.