< html >
< body >
< script type ="text/javascript" >
function AscSort(x, y)
{
return x == y ? 0 : (x > y ? 1 : - 1 );
}
function DescSort(x, y)
{
return x == y ? 0 : (x > y ? - 1 : 1 );
}
var y = new Array(3, 1 , 2 );
y.sort(AscSort);
alert(y);
</ script >
</ body >
</ html >


function AscSort(x, y)
{












