微语 微语:代码适合中午敲,早晚出BUG

JS三目运算比大小 JavaScript

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <script>
            function getThreeMax(x, y, z) {
                return x > y ? (x > z ? x : z) : (y > z ? y : z);
            }
            max = getThreeMax(8, 0, 1)
            console.log("最大值:", max);
        </script>
    </body>
</html>