首页 > 代码库 > 关于js函数的形参和实参

关于js函数的形参和实参

    window.onload = function(){        function dada(name){            alert(arguments.length);//获取实际被传递参数的数值。实参  //3                   alert(dada.length);// // 获取期望参数的数值,函数定义时的预期参数个数,形参  //1                    alert("i‘m " + name + arguments[1] + " years old." + "i‘m in " + arguments[2] );//name等于arguments[0]  im jiangsen 23 years old im in chengdu                }            dada("jiangsen",23,"chengdu")        }

 

关于js函数的形参和实参