Array length, when index is string-based

Hi everyone

just a simple example:

var a = new Array()
a[“apple”] = “red”
a[“orange”] = “orange”
a[“banana”] = “yellow”

trace(a.length) //returns 0

Why on earth does that happen? Anyone knows a way to get it work?

I should try something with for(var item in a)