«

JS三目运算比大小

时间:2023-3-12 10:45     作者:小诸葛     分类: 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>

比大小

推荐阅读:


扫描二维码,在手机上阅读