Filename-js6.html
<html>
<head>
<script language="javascript">
var no=new Array(0,1,2,3,33,6,58,89,991);
document.write("Array no are="+no+"<br>");
function compare(a,b)
{
return a-b;
}
document.write("sorting order=");
document.write(no.sort(compare));
//document.write("<br>"+"print"+no.slice(0,no.length));
document.write("<br>"+"remove max no print=");
for(i=0;i<no.length-1;i++)
{
document.write(no[i]+",");
}
<!-- for(i=0;i<no.length;i++)
{
for(j=i;j<no.length;j++)
{
if(no[i]<no[j])
{
//document.write(no[i]);
//var no2=
}
}
}
-->
</script>
</head>
</html>
Output
Array no are=0,1,2,3,33,6,58,89,991 sorting order=0,1,2,3,6,33,58,89,991 remove max no print=0,1,2,3,6,33,58,89
No comments:
Post a Comment