elixir-book/maps/dynamic_nested.exs

20 lines
310 B
Elixir
Raw Normal View History

2023-05-07 13:20:52 +02:00
nested = %{
buttercup: %{
actor: %{
first: "Robin",
last: "Wright"
},
role: "Princess"
},
westley: %{
actor: %{
first: "Cary",
last: "Elwes"
},
role: "farm boy"
}
}
IO.inspect get_in(nested, [:buttercup])
IO.inspect get_in(nested, [:buttercup, :actor])