Blogger Information
Blog 28
fans 1
comment 0
visits 17297
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
2019.5.6作业
关超的博客
Original
635 people have browsed it
1. 写一个while循环, 输出一个数值数组所有的奇数
<html>
<head>
    <title>js学习</title>
    <meta charset="utf-8">
    <script type="text/javascript">
        var arr = [1,3,5,2,4,6,12,14,15,37];
        var a = 0;
        var lenth = arr.length;
        while (a<lenth) {
            if(arr[a]%2!==0){
                console.log(arr[a])
            }
            a+=1;
        }

    </script>
</head>
<body>


</body>
</html>


2.写一个对象字面量, 描述一款你喜欢的手机信息

<script type="text/javascript">
    var myphone = {
        pname:"ipone8plus",
        pprice:6388,
        pmade:'China'
    };

    console.log('手机***信息: '+ myphone.pname );
    console.log('手机价格信息: '+ myphone.pprice );
    console.log('手机产地信息: '+ myphone.pmade );
</script>

3. 写一个函数表达式, 计算三个数之和

<script type="text/javascript">

    var res = function sum(a,b,c){
       return console.log(a+b+c);
    };

    res(11,33,55);


</script>


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