I wish to wait on the array of promise objects from a series of calls. But when I use the following call nothing happens:
$.when.apply(null, promises).done(processFinalTable());
Execution of the code following works as expected:
$.when.apply(null, promises).done(processFinalTable);
What is going on here at an execution level?
Here is a link to a working jsFiddle example
In the first one, you are invoking the function processFinalTable, and passing its result to done().
In the second one, you are passing the function itself, which is what done() needs to execute properly.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments