Get the index of an array by position
<p>I want to get the index of an array by position. Is this possible? For example, I want the following function to print:</p>

<pre><code>var args = new Array();
args["name"] = "john";
args["surname"] = "smith";

printPerson(args);
function printPerson(args) {

    for(var i = 0; i &lt; args.count; i++) {
        ???
    }
}
</code></pre>

<blockquote>
  <p>"name:john surname:smith"</p>
</blockquote>

<p>(ie <code>name</code> &amp; <code>surname</code> should not be hardcoded inside function)</p>

<p><strong>EDIT</strong><br>
The order they printed out is not important!</p>
