码迷,mamicode.com
首页 > 其他好文 > 详细

函数名称

时间:2018-08-27 21:47:20      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:fun   名称   null   alc   ret   charset   efi   alert   eof   

<!DOCTYPE html>
<html>
          <head>
                 <meta charset="utf-8">
                 <title></title>
          </head>
          <body>
                  <script type="text/javascript">
                  test();
                  function test(){
                           alert(‘this is a test‘);
                   }                                                            函数名称严格区分大小写

                  function  TEST(){
                           alert("hello king");
                   }
                TEST();
                test();
                function test(){
                       alert(‘hello nana‘);                                 函数名称重复会产生覆盖
                }
                test();                                                                               
                function test1(){
                           alert(‘this is test1 function‘);
                }
                //alert(test1());
                 function test2(){
              // return null;
              // return undefined;
              // return;
             // return true;
             // return ‘this is king‘;
             // return 1.2;
            alert(‘this is a test‘);
             // return 1;
            }
          //alert(typeof (alert(‘this is a test‘)));


            function calc(num1,num2){
                    return num1+num2;
            }
             // alert(calc(1,2));
              // alert(window.calc(3,5));
              // alert(calc(1,2,3,4,5,6));
           function calc1(num1=1,num2=2){
                     return num1+num2;
           }
           function calc1(num1,num2){
                    num1=num1||1;
                    num2=num2||2;
                    return num1+num2;
            }
             alert(calc1());
             </script>
       </body>
</html>

函数名称

标签:fun   名称   null   alc   ret   charset   efi   alert   eof   

原文地址:https://www.cnblogs.com/d-z-j-boke/p/9543600.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!