yes, as far as how you return the value, however read below code.
- var foo = {
- one: "foo",
- two: "bar",
- three: "foobar"
- };
- alert(foo["one"]);
- alert(foo.two);
- for ( var item in foo ) {
- alert("The value of foo['" + item + "'] is: " + foo[item]);
- }
Edit: i'm not sure if there is a way to get the local variables in the same way you would global ones on the window object.
Edit2: did a little more research because this was interesting, here's a stackoverflow question that i think is related:
Looks like the answer is no, it is not possible.
-- Kevin