Array Flash ActionScript

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var fruits:Array = ["apples", "oranges", "pears"];
        
        fruits[3] = "tangerines";
        
        fruits[39] = "grapes";
        
        trace(fruits); // Displays: undefined
        trace(fruits[12]); // Displays: undefined
    }
  }
}
apples,oranges,pears,tangerines,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,grapes
undefined