javascript nested object from array Unexpected token [ : <p>I do not understand why I get <code>Uncaught SyntaxError: Unexpected token [</code> when I do the following:</p>

<pre><code>    var thisarray = ["one","two","three"]
    var thisobj = {
                     thisarray[0] : {thisarray[1] : thisarray[2]}
                  }
</code></pre>

<p>There is a similar syntax error that I get from trying this:</p>

<pre><code>$scope.find_settings.find = {$scope.query_main_type:findarray}
</code></pre>

<p>here the unexpected token is <code>.</code>. Doesn't javascript resolve the expressions when creating objects or what is happening here?</p>
