search

Home  >  Q&A  >  body text

为什么定义函数名为sum时就只能输出一组而已??

看透不说透看透不说透2925 days ago1058

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:07:01

    Why can only one group be output when the function is named sum? ? -PHP Chinese website Q&A-Why can only one group be output when the function name is defined as sum? ? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-20 13:27:24

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>函数传参</title>
    <script type="text/JavaScript">
       function sum(x,y,z)                
     {
       sum1 = x + y +z;
       document.write(x+"、"+y+"、"+z+"和:"+sum1+"<br/>");
     }
      sum(5,8,3);
         sum(7,1,4);
       
    </script>
    </head>
    <body>
    </body>
    </html>

    方法名不能和定义和的值一样,不然只能执行一次。

    reply
    2
  • Cancelreply