Indexes aren't always numbers, they can be anything else (but by default, unless you add them by yourself, it will be numbers). And yes, in your example it will remove everything since no index is an element.
On your last code, I didn't get some things:
I already said you don't need that in iteration statements.
Okay.. What is that?
@IIYAMA, it's still not right. 'v' is the value, not an array. You can't do "v", it doesn't even make sense.