What does this mean?


#1

Help!


var greeting = function (name)


what does the name do there and what does it mean?


#2

This is what we call the formal parameter of the function. name will be a locally defined variable that receives the value passed in the argument of the function call.

greeting("Wee Gillis")

Inside the function, the above name (the quoted value) will be stored in name

var greeting = function (name) {
    // when called with the above
    // `name` will be `"Wee Gillis"`
    // code
}

#3

Thanks mtf . ;p :wink:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.