&lt !DOCTYPE html>

<html>

<body>


<h2>JavaScript Array Sort</h2>


<p>Click the button to sort the array in descending order.</p>


<button it</button>


<p id="demo"></p>


<script>

var points = [40, 100, 1, 5, 25, 10];

document.getElementById("demo")[removed] = points;


function myFunction() {

    points.sort(function(a, b){return b - a});

    document.getElementById("demo")[removed] = points;

}

</script>


</body>

</html>


https://www.w3schools.com/js/tryit.asp?filename=tryjs_array_sort3


이건데 function(a, b){return b - a} 이부분이 이해가 안감


자바스크립트 배운지 2일째인데 빡대가리라 이해가 안간다 도움좀..