Actionscript uses sparse arrays, so I can have an array like this:
var myArray:Array = new Array();
myArray[0] = "foo";
myArray[22] = "bar";
Now myArray.length will give me 23. Is there a way to get the actual number of items in the array without iterating every element?
If you don’t want to iterate through the array, you can filter it: