Guest User

Untitled

a guest
Dec 10th, 2019
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title> TABELA </title>
  6.  
  7. </head>
  8. <body>
  9.  
  10. <div id="div1" ></div>
  11. <div id="div2" ></div>
  12. <div id="div3" ></div>
  13. <script type="text/javascript">
  14. function porownaj(a, b)
  15. {
  16. return a-b
  17. }
  18. var Tablica = new Array(27,100,10,450,1654,320,-34,-88, -27);
  19.  
  20. document.getElementById("div1").innerHTML="Bez sortowania: "+Tablica;
  21.  
  22. Tablica.sort();
  23. document.getElementById("div2").innerHTML="Sortowanie domyślne: "+Tablica;
  24.  
  25. Tablica.sort(porownaj);
  26. document.getElementById("div3").innerHTML="Sortowanie poprawne: "+Tablica;
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. </script>
  35.  
  36. </body>
  37. </html>
RAW Paste Data