Javascript找Array的最大值

Array的方法可以參考:Array - JavaScript | MDN

<body>
    <script>
        ar1 = [1, 6, 8]
        console.log(Math.max(2, 8, 6))
        console.log(Math.max(...ar1))
        console.log(Math.max.apply(ar1, ar1))
    </script>
</body>

image