<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="智能社 - zhinengshe.com">
<meta name="copyright" content="智能社 - zhinengshe.com">
<title>智能社 - www.zhinengshe.com</title>
<script> var arr=[, , , , , , ]; for (var i=; i<arr.length; i++)
{
var nMinIndex=findMin(arr, i); var tmp=null;
tmp=arr[nMinIndex];
arr[nMinIndex]=arr[i];
arr[i]=tmp;
} alert(arr); function findMin(arr, start)
{
var nMin=;
var nMinIndex=-; for (var i=start; i<arr.length; i++)
{
if (arr[i]<nMin)
{
nMin=arr[i];
nMinIndex=i;
}
} return nMinIndex;
} </script>
</head> <body>
</body>
</html>