var arr = [12,31,11,3,88]; var contrast = 99999999999; var iIndex = -1; for(var i=0;i<arr.length;i++){ if(arr[i]<contrast){ contrast = arr[i]; iIndex = i; } } alert('最小值是:'+contrast+',索引是:'+iIndex);