标签:pie keyword local 的区别 more 语言 ati 特点 提前
function addscore(score,score){
body;}
The function does all the work of instantiating the variable for you, so you don‘t need to supply the var keyword in front of your parameter names
与c语言不同的地方:
可以使用 value,variable 和 expression 作为 function 的 argument.
argument 和 parameter 是不同的 :You‘ll only define your parameters once, but you‘ll probably call your function with many different arguments
argument 和 parameter 是通过 pass-by value 来传递的,each argument is copied into the parameter variable.
如果 argument 的数量少于 parameter:那么少的 argument 定义为 undefined
如果 argument 的数量多于 parameter:那么多的 argument 将被 ignored.
按 scope 分,可分为 global 和 local ,并且两者不会相互影响。
如果一个 function 中有一个 local variable,那么这时候 global variable is in the shadow of local variable and be not visiblel.
标签:pie keyword local 的区别 more 语言 ati 特点 提前
原文地址:https://www.cnblogs.com/FBsharl/p/10153819.html