<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{padding:0;margin:0;}
li{list-style:none;}
</style>
</head>
<body>

<script>
var arr=[999,992,997,22,38,8,923,232,1023];
var minArr=9999;
var maxArr=1;
var minIndex=0;
var maxIndex=0;
for(var i=0;i<arr.length;i++){
if(arr[i] < minArr){
minArr=arr[i];
minIndex=i;
}
}
alert(minArr+'+'+minIndex);
for(var i=0;i<arr.length;i++){
if(arr[i] > maxArr){
maxArr=arr[i];
maxIndex=i;
}
}
alert(maxArr+'+'+maxIndex);
</script>
</body>
</html>