title: Array Passed to JavaScript Function through onClick is creating [object, object]
body: <p>I want to append data to a jquery Modal through onclick and passing array into a function is creating problem. My code is as follows:-</p>
  
  <pre><code>var ttlpndordsqnty = topBarData['ttlpndngordrs'].length;
  var ttlpndordsdata = topBarData['ttlpndngordrs'];
  $('#totalpendingtestorders').empty();
  $('#totalpendingtestorders').append('&lt;a onClick="populateWidgetInfo(\''+ttlpndordsdata+ '\')" class="count red" data-toggle="modal" data-target="#totalpndgordModal"&gt;&lt;label &gt;' +ttlpndordsqnty+ '&lt;/label&gt;&lt;/a&gt;');
  
  function populateWidgetInfo(data)
  {
      console.log(data);
  
  } //end function
  </code></pre>
  
  <p>when i click on this then the following is returned instead of array passed. Kindly help me?</p>
  
  <pre><code>[object Object],[object Object],[object Object]
  </code></pre>