Passing object array - Unexpected token [
<pre><code>function showConfirm(reArray) {

    var theHTML = '';
    var optionArray = ["Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7"]; 
    var myButtons = {};
    var j = 1;

    for(var i = 0; i &lt; reArray.length; i++){

                theHTML  +='&lt;div style="text-align:center"&gt;' 
                         + '&lt;span&gt;'+j+'.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'
                         + '&lt;span&gt;'+reArray[i].RoadNo+'&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'
                         + '&lt;span&gt;'+compass_image(reArray[i].Bearing)+'&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'
                         + '&lt;/div&gt;&lt;br/&gt;'    

                j++;
        }

    for(i = 0; i &lt; reArray.length; i++){

    ERROR HERE -----&gt; var placeFunction = function(reArray[i]){

                                plotRoadInfo(reArray[i]);
                                $(this).dialog("close");
                            };

                            myButtons[optionArray[i]] = placeFunction;
    }

    $( "#dialog-modal" ).dialog({
      height: 300,
      modal: true,
      buttons: myButtons

    });

    $('#multipleRE').append(theHTML);
}
</code></pre>

<p>So the function gets passed an object array (reArray), it then creates an array of buttons (myButtons) for a jquery dialog box. I'm attempting to to pass reArray[i] to the function that will be used by each button, which is to execute plotRoadInfo(reArray[i]);</p>

<p>I keep getting "Unexpected token [", and I can't figure out why for the life of me.</p>
