In the example below, a map called someCompany have a map called somePerson in one of its values
val somePerson = mapOf("name" to "Tim", "age" to "35")
val someCompany = mapOf("boss" to somePerson, "sector" to "accounting")
I thought it would be simple to get a value inside the nested map. I'm kind of surprised this naive solution doesn't work:
val a = someCompany["boss"]
val myOutput = a["name"] //I expected myOutput to be 'Tim', but this doesn't work
How can I extract a value inside a nested map?