actionscript-3apache-flexflex3

Fastest way to delete one entry from the middle of Array()


What is the fastest way to delete one specific entry from the middle of Array()

Array is large one having Strings.

I dont want just to set Array[5] = null, but instead array size should be reduced by one and array[5] should have content of array[6] etc.


Solution

  • Don't have any benchmarks to support this, but one would assume that the native Array.splice method would be the fastest...

    So, to remove the entry at index 5:

    array.splice(5, 1);