前端學習(1630):前端系列實戰課程之函數返回值

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function show(a) {
            return '脫了馬甲的烏龜'
        }
        show('烏龜');

        function toDouble(num) {
            return num * 2;
        }
        toDouble(1);

        function rnd(m,n) {
            return m + Math.random() * (n - m);
        }
        alert(rnd(5, 15))
    </script>
</head>

<body>

</body>

</html>

運行結果

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章