<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Array对象 </title>
<script type="text/javascript">
function sortNum(a,b) {
return b-a;
}
var myarr = new Array("80","16","50","6","100","1");
var mystr=new array();
mystr=myarr.sort(sortNum);
var i=0;
for(i;i<mystr.length;i++;)
document.write(mystr[i]+"<br/>");
</script>
</head>
<body>
</body>
</html>
"var mystr=new array()" ==> "var mystr = new Array()"
"for(i;i<mystr.length;i++;)" ==> "for(i;i<mystr.length;i++)“
var mystr=new array()这里错了