一般写函数,我们会这样调用:function add(x, y) { return x + y;}alert(add(2, 3));或者这样:var add = function(x, y) { return x + y;}alert(add(2, 3));匿名函数,使用()将匿名函数括... Read More
posted @ 2015-11-27 22:31 tinyphp Views(341) Comments(0) Diggs(0)
变量作用域:局部和全局局部变量优先级别高于同名的全局变量//声明一个全局变量var scope="global";function checkscope(){ //声明一个同名的局部变量 var scope="local"; //返回的是局部变量的值 return scope... Read More
posted @ 2015-11-27 21:06 tinyphp Views(290) Comments(0) Diggs(0)