I have the following array setup
Code:function Franchise (id, name) { this.id = id; this.name = name; } var franchiseDatabase = new Array(); franchiseDatabase['fid_0000'] = new Franchise('0000', 'Team 0'); franchiseDatabase['fid_0001'] = new Franchise('0001', 'Team 1'); franchiseDatabase['fid_0002'] = new Franchise('0002', 'Team 2'); franchiseDatabase['fid_0003'] = new Franchise('0003', 'Team 3');
I need to figure out the number of elements in franchiseDatabase
alert(franchiseDatabase.length) returns 0 when I thought it should return 4.
What is the proper way to count the # elements for franchiseDatabase if the array is set up like I have above?


Reply With Quote
Bookmarks