I'm writing an application in Flex / ActionScript and have a number of class member variables of type Array storing data.
My question is: what's the "best" way to clear out an Array object?
I noticed the ArrayCollection class has a function removeAll() which does this, but the basic Array class does not. Some possibilities I've considered are:
- Iterating through the array, calling pop or shift on each element
- Setting the array length to 0
- Setting the member variable to a "new Array()" or "[]"