I've been looking to clear an array in ActionScript 3.
Some method suggest : array = [];
(Memory leak?)
Other would say : array.splice(0);
If you have any other, please share. Which one is the more efficient?
Thank you.
array.length = 0
or array.splice()
seems to work best for overall performance.
array.splice(0);
will perform faster than array.splice(array.length - 1, 1);