So, I think my question should be fairly straightforward, I am just looking for a little clarification on why I'm getting these seemingly odd results when I try to use the Array.indexOf method with null. Here's my code:
var myArray:Array = new Array(20);
trace(myarray.indexOf(null)); //output: -1
trace(myarray[0] == null); //output true
So, it looks like the elements of an array are defaulted to null when a length constructor parameter is initialized, but why does indexOf(null) not return 0?