function Sortnumber ( A, A, (a) {return(A-b); }
Here the return of their difference, if the value is less than 0, will be a row in front, if greater than 0 will be b in front, if it is 0, just casually. Examples are as follows:
<script type= "Text/javascript" > function sortnumber (b) {return A- B} var C4>new Array (3) arr[0] = "ten"; arr[1] = "5"; arr[2] = "4"+ "<br/>"); document.write (Arr.sort (Sortnumber)); </script>
Then the arrangement of the original 10,5,4 will become 4,5,10. Here is a description of the process, obviously sortnumber should have two parameters, but we call when a parameter is not, how to compare ah? Here is the case when Arr calls sort from the first number, 10 is no number compared to it, so the second, that is 5, then 10 will be compared with 5, so it will call Sortnumber and 10 and 5 in, this is the character of sort ().
About the bubble Sort method