hàm không có return RUN
x
 
1
<!DOCTYPE html>
2
<html>
3
    <head>
4
        <title>Tìm số lớn nhất</title>
5
        <meta charset="UTF-8">
6
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
    </head>
8
    <body>
9
        <script language="javascript">
10
            
11
            function compareNumber(a, b)
12
            {
13
                if (a > b){
14
                    alert("Số thứ nhất lớn hơn số thú hai");
15
                }
16
                else if (a < b){
17
                    alert("Số thứ nhất bé hơn số thú hai");
18
                } else {
19
                    alert("Số thứ nhất bằng số thứ hai");
20
                }
21
            }
22
23
            var a = parseInt(prompt("Nhập vào số đầu tiên"));
24
            var b = parseInt(prompt("Nhập vào số thứ hai"));
25
26
            compareNumber(a, b);
27
            
28
        </script>
29
    </body>
30
</html>