Blogger Information
Blog 77
fans 0
comment 0
visits 55251
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
JavaScript基础作业练习_1021
Jet的博客
Original
670 people have browsed it
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        var name = '小李飞刀';
        //alert(name);
        /*
        var age = 16;
        if (age > 18) {
            alert('您已成年;');
        } else {
            alert('您还未成年;');
        }
        */
        var age = 18;
        var res = age < 26;
        //alert(typeof(res));

        //对象
        var obj = new Object();
        //alert(typeof(obj));

        //数组
        var arr = [1, 2, 3, 4, 5];
        //alert(typeof(arr));

        //自定义函数,匿名函数
        function func(num1, num2) {
            var sum = num1 + num2();
            return sum;
        }
        var result = func(2018, function() {
            return 2019;
        });
        alert(result);
    </script>
</head>

<body>

</body>

</html>

Correction status:qualified

Teacher's comments:其实脚本 语言的语法 都差不多的
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post