<button onclick="AscendingSorting()">Ascending</button>
<button onclick="DescendingSorting()">Descending</button>
<p id="demo"></p>
<script>
var points = [40, 100, 1, 5, 25, 10];
document.getElementById("demo").innerHTML = points;
function AscendingSorting() {
points.sort(function(a, b){return a>b});
document.getElementById("demo").innerHTML = points;
}
function DescendingSorting() {
points.sort(function(a, b){return b>a});
document.getElementById("demo").innerHTML = points;
}
</script>