I have simple js object, that I use as Map (but it...
# javascript
l
I have simple js object, that I use as Map (but it's not a js Map). Like
{someId1: Obj1, someId2: Obj2}
How can I access to it in kotlin? I can't come up with external definition.
k
No, you can
Copy code
external interface Foo {
    var someId2: Obj1?
    var someId2: Obj2?
}
l
Key is dynamic of course, I use this as Map
k
Ah, I see.
Json
perhaps?
l
Json is like <String, Any?>. I whant to specify Any. Should I just write my own Json<T>?
k
Specify Any as a key?
Ah, I see. Yes, you can write your own Json
l
.... Yes I can 🙂 Is there already written analog in std library?
k
I don't know
l
.. and I need to iterate over it. There should be simple solution I think. To use POJsO as Map<T,V>
k
You can iterate using JavaScript functions, like
Object.keys()
l
It's weird but it's works...