Skip to content

Instantly share code, notes, and snippets.

@andrewjmead
Created May 28, 2016 23:03
Show Gist options
  • Save andrewjmead/99815bc7013b49042be1e88e324cd33c to your computer and use it in GitHub Desktop.
Save andrewjmead/99815bc7013b49042be1e88e324cd33c to your computer and use it in GitHub Desktop.
Jerome Argument Names
function add (a, b) {
return a + b
}
var result = add(1, 2);
console.log(result);
@auchomage
Copy link

Thanks Andrew, I can see that parameters 'a' and 'b' serve as placeholders for any values that are sent down to the function when called. These values are then added up (manipulated) to produce the result we want. - understood

But here, ( (https://gist.github.com/auchomage/80e8c7ce5debfb7b44343462ad802582) ). In file 'location2.js', line 5. What value(s) are being passed if any?

If we want values why not use the return result of 'callback()'

ie callback(){
return some value
}

then we can say

someVar = callback(); // this would assign the return value of calling the function 'callback()', to a a variable (here called 'someVar'), that can be used as we see fit.

But that isn't occurring here and I can't see why. I hope you can see what I mean, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment