
Obe Juarez
6,355 PointsIs 'callback' just a sort of variable name, or does is it actually a JS special keyword?
Im having a hard time understanding if 'callback' is actually a special word in JS? for example: function name(a, b, user) {
} can I just input my own variable or does it have to be callback because callback is actually a method of sorts?
1 Answer

Clayton Perszyk
Treehouse Moderator 46,629 PointsYou can name callback whatever you want. It's not a reserved keyword. All that is required is that you pass a function that can be "called" after task is complete.
Obe Juarez
6,355 PointsObe Juarez
6,355 PointsClayton Perszyk Ok so, lets say I have like 5 parameters inside a function, the last parameter isn't necessarily the function right, I can have the function in the third perimeter if I wanted to?
Clayton Perszyk
Treehouse Moderator 46,629 PointsClayton Perszyk
Treehouse Moderator 46,629 PointsObe Juarez Actually all parameters must be passed in the correct order. If the callback is the last, you will need to pass a callback function. The 3rd parameter COULD be a callback, but it would be based on how the function was written. The convention and best practice is to have the callback as the last parameter.