I do not understand why I get Uncaught SyntaxError: Unexpected token [
when I do the following:
var thisarray = ["one","two","three"]
var thisobj = {
thisarray[0] : {thisarray[1] : thisarray[2]}
}
There is a similar syntax error that I get from trying this:
$scope.find_settings.find = {$scope.query_main_type:findarray}
here the unexpected token is .
. Doesn't javascript resolve the expressions when creating objects or what is happening here?