代码示例:(标识:jsck_sort_low)
<!DOCTYPE html>
<html>
<body>

<h1>JavaScript 数组</h1>

<p>sort() 方法对数组的项目进行排序。</p>

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

<script>
const points = [40, 100, 1, 5, 25, 10];

// Sort the numbers in ascending order:
points.sort(function(a, b){return a-b});

// points[0] is now the lowes value:
document.getElementById("demo").innerHTML = points[0];
</script>

</body>
</html>
运行结果: