SOURCE

console 命令行工具 X clear

                    
>
console
<!DOCTYPE html> 
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    
		<a href="https://www.bilibili.com/" target="_blank">bilibili</a>		
        <br>
    <script>
        //定义全局变量c
         var c=0;
        //定义局部变量a,b
        function sum(a,b) {
           
            c=a+b;
            return c;
        }
        document.write("1和2的和为:" + sum(1, 2));
     </script>

    <br>

    <script>
         function isLeapYear(year) 
         {
            //判断闰年的条件
            if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) 
            {
                return year + "年是闰年"+"<br/>";
            }
            else
            {
                return year + "年不是闰年"+"<br/>";
            }
         }
        //调用函数
        document.write(isLeapYear(2022));
        document.write(isLeapYear(2000));
        document.write(isLeapYear(2001));
    </script>
</head>
<body>
</body>
</html>