<h2>JavaScript Dizi Sıralama</h2> <button onclick="siralama()">Sırala</button> <p id="demo"></p> <script> var sayilar = [25, 9, 12, 33, 87, 1, 42]; document.getElementById("demo").innerHTML = sayilar; function siralama() { sayilar.sort(function(a, b){return a - b}); document.getElementById("demo").innerHTML = sayilar; } </script>