<html>
<body>
<p>Click the button to get the lowest number in the array.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
var points = [40, 100, 1, 5, 25, 10];
document.getElementById("demo").innerHTML = points;
function myFunction() {
points.sort(function(a, b){return a-b});
document.getElementById("demo").innerHTML = points[0];
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_sort_low by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:01:27 GMT -->
</html>