Currently, I'm delving into the world of AngularJS and came across this code snippet in the image below while following a tutorial. The instructor is utilizing
$http.get("url").then(function()...
. What's confusing me is that the onUserComplete
function expects a response
parameter, yet it's not being passed within the then
function, and surprisingly, the example still functions as intended. In my understanding of JavaScript, shouldn't we be doing something like: then(onUserComplete(response));
Can someone shed some light on this?