Given the following object, how would I dynamically access both levels of data?
var object = { "one": { "0": "foo", "1": "foo foo", "2": "foo foo foo", "3": "foo foo foo foo", "4": "foo foo foo foo foo" }, "two": { "0": "bar", "1": "bar bar", "2": "bar bar bar", "3": "bar bar bar bar", "4": "bar bar bar bar bar" } }; Shouldn't I be able to do something along the lines of:
var outer = "one", inner = "3"; console.log(object[outer][inner]); And have the output be "foo foo foo foo"?