javascript的函数,定义

函数

  function       A               ()          { }
函数体开头    函数名    传入的参数     方法


<button onclick="myFunction('Bill Gates','CEO')">点击这里</button>       //当按钮点击时,响应myfunction方法,并传入('Bill Gates','CEO')参数

<script>                                                                                             //记得传参数是  '参数'  形式。


function myFunction(name,job)                 //传入的参数按照这个规格套上,
{
alert("Welcome " + name + ", the " + job);     //从而按一下按钮,弹出welcom Bill Gates ,the CEO 。“  ”里有,
</script>

定义:
var m;
var m=1;
var m=false;
var m=1+1;

原文地址:https://www.cnblogs.com/liyihome/p/3722721.html