Hekumok,
<script type="text/javascript">
var Arr_1 = [2, 'crack', 'find', 2];
function Find_El_Array ( arr, val ) {
var array_OUT = [];
for(var i in arr) {if (val == arr[i]) array_OUT.push(i);}
if(array_OUT.length) return array_OUT;
return -1;
}
alert( Find_El_Array (Arr_1, 2) )
alert( Find_El_Array (Arr_1, 1) )
</script>