Array is lost after passed to a function
<p>I'm getting a length of 0 for the incoming array to this method below and undefined for the array properties that's being passed in below and not sure why:</p>

<pre><code>function BindAlbumDropdownList(aAlbums, defaultAlbumID)
{
    if(aAlbums.length == 0)
        return;

    var albumDropdownID = $("#abumDropdown").attr("id");

    AddDropdownItem("-Select an Album-", "-1", "albumDropdown");

    for(var a in aAlbums)
    {
        alert("a.name, a.id, albumDropdown: " + a.name + "|" + a.id + "|" +  albumDropdownID);
        AddDropdownItem(a.name, a.id, albumDropdownID);
    }
}
</code></pre>

<p>I'm passing in an array that was defined earlier in another method that calls this method and the array was defined and passed like this:</p>

<pre><code>var aAlbums = GetAllAlbums(userID, accessToken);
var defaultAlbumID = aAlbums[0].id;

BindAlbumDropdownList(aAlbums, defaultAlbumID)
</code></pre>

<p>GetAllAlbums is returning a variable setup like this inside it:</p>

<pre><code>var aFacebookAlbums = []; // array
</code></pre>

<p>and returns this array once populated.</p>

<p>but when I enter the for loop in the BindAlbumDropdownList, I'm getting undefined for the array properties as well as the check for length is zero</p>

<p>here's what the alert is giving me:</p>

<pre><code>a.name, a.id, albumDropdown: undefined|undefined|albumDropdown
</code></pre>

<p>I am positive GetAllAlbums is returning an array with values in it because<br>
<code>var defaultAlbumID = aAlbum[0].id;</code> gives me a valid value</p>

<p>I noticed that it seems like BindAlbumDropdownList doesn't really know the incoming aAlbums is an array even though I am passing an array to it.  Because I'm getting no intellisense showing the property array when trying to do aAlbum.length but I do get the .length property on the array just before I return it from the GetAllAlbums function.</p>
