Passing an object as parameter return an array in JavaScript <p>I have the following simple code :</p> <pre><code>&lt;td data-title="Authorized Version"&gt; &lt;span ng-bind="table.authorizedVersion.version"&gt;&lt;/span&gt; &lt;/td&gt; &lt;td data-title="Actions" ng-hide="userRole"&gt; &lt;button class="btn btn-default round" ng-click="modal.open('lg','pickKey', table)"&gt;&lt;/button&gt; &lt;/td&gt; </code></pre> <p>When I click on the button, I want to get the table data :</p> <pre><code>modal.open = openModal; function openModal (size, whichModal, data) { console.log(data); } </code></pre> <p>My problem is : </p> <p>table.authorizedVersion is an object. But, in the function, it appears as an empty array.</p> <p>Why is this function converting my object into an array ? </p> <p>Thank you in advance for your assistance.</p>