//数组中找两个最小值,及索引 //例如数组: [2,6,7,4,10,3,5]; 计算得出,min1=2,index1=0,min2=3,index2=5; var min1 = Infinity; var min2 = min1; var index1 = -1; var index2 = -1; var arr = [2,6,7,4,10,3,5]; for(var i = 0; i < arr.length; i++ ){ var item = arr[i]; if(item < mi…