Javascript找Array的最大值

Array的方法可以參考:https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Array

<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