var arr = ['test1', 'test2', 'test3','test4','test5','test6']; function $del(a, b) { for(var i in a) if(a[i] == b) delete a[i]; return a; } arr = $del(arr, 'test2');