I ran into a problem when I was trying to access a property of an index of a global array by using a string. I have dynamically generated string that looks something like this:
var foo = "arr[0].prp[0].prp[1]"
The index in the array and how deep it is, is dynamic and I'm just providing an example of what it may look like.
Now the problem is when I try to use this string to get a property like this, it fails:
foo.something
,foo["something"]
,window[foo].something
orwindow[foo]["something"]
I can however use eval() to get it to work, but I would really like to get away without having to use it.
Anyone have any suggestions or ideas?