Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Asynchronous Programming with JavaScript Asynchronous JavaScript with Callbacks Callbacks Review

Obe Juarez
Obe Juarez
6,357 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,357 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,835 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.