What does this mean?



var greeting = function (name)

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


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


Thanks mtf . ;p :wink:


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