Relay Teams In JavaScript.

Relay Teams In JavaScript.

By Google's results , "A relay race is a racing competition where members of a team take turns completing parts of racecourse or performing a certain action".

However, this phenomenon of taking turns to complete an action isn't limited to the racetracks. It also happens in JavaScript, under an odd moniker , "callbacks".

In a callback function, there is usually more than one argument, sometimes even three.

However, since the aim of a function is to carry out an enclosed task on its own, irrespective of the number of arguments, we can say that the arguments are the members of the relay team , i.e the function.

This is accurate because, in a callback function , immediately each argument has done it's job in the function, it passes the baton of action to the next and so on, till it reaches the finish line, that is , the last argument and ends the function.

 Thus, I call callbacks "JavaScript Relay Teams".

I hope this helps someone understand this concept as it is a little tricky.