var array = [5,8,1,9], i = array.length, min = array[0], index = 0; while (i--) { if (array[i] < min) { min = array[i]; index = i; } } alert("array[" + index + "] = " + min);