I have read this question:
Deleting array elements in JavaScript - delete vs splice
And it appears that both splice and delete require an index of the elemen
You can jQuery's $.inArray and get rid of your $.each loop, and it works cross-browser (unlike Array.indexOf):
$.each
var index = $.inArray("test2", ["test1", "test2", "test3"]); // 1
(I realise your question is not tagged with 'jQuery', but you do mention that you're already using an $.each loop).