How to pass extra / additional parameters to the deferred.then()function in jQuery, $q (AngularJS) or Q.

  Q or $q If you are using Q or $q you can pas extra data to the then function by using the $q.all function: function execute() { var firstNames = [‘Bo’, ‘Cris’, ‘Richard’]; $q.all({ firstNames: $q.when(firstNames), lastNames: $http.get(‘/api/lastNames’) }).then(handleGetLastNamesResult) } function handleGetLastNamesResult(data) { var firstNames = data.firstNames; var lastNames …