in reply to Re: (MeowChow) Re2: How do I remove an element from any array while iterating over it in a loop?
in thread How do I remove an element from any array while iterating over it in a loop?

Another item to be aware of. Removing every other element in a list through using splice is O(n*n). Using grep is O(n).

In this case it probably doesn't matter. But with a lot of filtering operations that is a good item to be aware of.

  • Comment on Re (tilly) 4: How do I remove an element from any array while iterating over it in a loop?