I have an object that looks like:
{
"id": 1,
"name": "Customer",
"parks": {
"1": "Park a",
"23": "Park b",
"7": "Park c",
"83": "Park d"
},
"users": {
"11": "[email protected]"
}
}
The value on the left side in parks
and users
is not an index, but the actual id
of the Park. How can I access this value in Javascript?
Currently I use Vue.Js, so I'm binding the value like this to a component:
<park-component v-for="park in customer.parks"
v-bind:prop="park"
v-bind:key="park.id">
</park-component>
This however, only binds the park value on the right side, i.e the name "park a". I need to be able to access the left side as well. If not possible through Vue in the html, can it be done in the script? i.e if I have:
"23": "park b"
How can I get 23
?