JavaScript Asynchronous Programming with JavaScript Asynchronous JavaScript with Callbacks Callbacks Review

Obe Juarez
Obe Juarez
6,355 Points

Is '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

Obe Juarez
Obe Juarez
6,355 Points

Clayton 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
Clayton Perszyk
Treehouse Moderator 46,629 Points

Obe 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.