Javascript change variable based on variable reference
<p>In a program i am writing i need an object variable that looks like this:</p>

<pre><code>var map {
    cube: {__pt3arraylocation__:[0,0,0], poly: new Object()},
    other: {__pt3arraylocation__:[1,0,0], poly: new Object()}
};
</code></pre>

<p>However, i want to be able to type map.cube and have it return the <strong>pt3arraylocation</strong> as a default unless i specify what i want by typing map.cube.poly</p>

<p>for example: map.cube would return [0,0,0] and map.cube.poly would return the object poly in the object cube</p>

<p>thanks in advance</p>
