Given this structure:
{
"foo":{
"bar":{
"baz":[
{
"foo bar":"baz",
"baz foo":"bar"
}
]
}
}
}
How can I select 'foo bar' from a variable such as:
var myString = "baz[0]['baz foo']";
There are many examples of how to do it using dot notation:
Accessing nested JavaScript objects with string key
Access / process (nested) objects, arrays or JSON
Reference Nested JavaScript Object
But none of them support key with spaces in it seems.
An example JS fiddle