What is happening when I use parenthesis in this function call to make it behave differently?

Nat

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

SO'Brien

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What is happening when I call unpack() as lua's function arguments?

From Dev

What's happening when I call `even(3)`, with `even` being a generator function?

From Dev

What's happening when I make changes in project that is a dependecy of a jar?

From Dev

What does a double parenthesis in a function call do?

From Dev

Nothing is happening when I call CollectionView:didSelectItemAtIndexPath

From Dev

what is happening when try to use array variable

From Dev

iOS: What is happening when I call a overridden method from other class

From Dev

What is happening when I call console.log within console.log?

From Dev

Do I have to use parenthesis in ruby function call before logical operator?

From Dev

What is happening when I compose * with + in Haskell?

From Dev

When I'm connected to two networks with internet access, what exactly is happening as I use internet?

From Dev

What built-in codesniff could I use to ensure there are no spaces before parenthesis and after function name

From Dev

what exactly happening when i am calling the following function called find_element_by_xpath?

From Dev

What is exactly happening when I am using setTimeout within another function and trying to print the value of the argument passed?

From Dev

What is happening in this make clean?

From Dev

call function without parenthesis

From Dev

Parenthesis in a perl function call

From Dev

Call a function without parenthesis?

From Dev

Parenthesis in a perl function call

From Dev

What is happening in this swift function?

From Dev

What is happening differently when cloning 1D array and 2D array

From Dev

What is happening differently when cloning 1D array and 2D array

From Dev

Why does braced-init-list behave differently in a function call versus a constructor invocation?

From Dev

What's really happening when we use a method as a parameter by reference?

From Dev

When to use parenthesis in knockoutJS?

From Java

What is happening when I add a char and a String in Java?

From Dev

What is happening when I left shift beyond INT_MAX ?

From Dev

In Python 3, what is happening when I index a bytearray?

From Dev

What's actually happening when I convert an int to a string?

Related Related

  1. 1

    What is happening when I call unpack() as lua's function arguments?

  2. 2

    What's happening when I call `even(3)`, with `even` being a generator function?

  3. 3

    What's happening when I make changes in project that is a dependecy of a jar?

  4. 4

    What does a double parenthesis in a function call do?

  5. 5

    Nothing is happening when I call CollectionView:didSelectItemAtIndexPath

  6. 6

    what is happening when try to use array variable

  7. 7

    iOS: What is happening when I call a overridden method from other class

  8. 8

    What is happening when I call console.log within console.log?

  9. 9

    Do I have to use parenthesis in ruby function call before logical operator?

  10. 10

    What is happening when I compose * with + in Haskell?

  11. 11

    When I'm connected to two networks with internet access, what exactly is happening as I use internet?

  12. 12

    What built-in codesniff could I use to ensure there are no spaces before parenthesis and after function name

  13. 13

    what exactly happening when i am calling the following function called find_element_by_xpath?

  14. 14

    What is exactly happening when I am using setTimeout within another function and trying to print the value of the argument passed?

  15. 15

    What is happening in this make clean?

  16. 16

    call function without parenthesis

  17. 17

    Parenthesis in a perl function call

  18. 18

    Call a function without parenthesis?

  19. 19

    Parenthesis in a perl function call

  20. 20

    What is happening in this swift function?

  21. 21

    What is happening differently when cloning 1D array and 2D array

  22. 22

    What is happening differently when cloning 1D array and 2D array

  23. 23

    Why does braced-init-list behave differently in a function call versus a constructor invocation?

  24. 24

    What's really happening when we use a method as a parameter by reference?

  25. 25

    When to use parenthesis in knockoutJS?

  26. 26

    What is happening when I add a char and a String in Java?

  27. 27

    What is happening when I left shift beyond INT_MAX ?

  28. 28

    In Python 3, what is happening when I index a bytearray?

  29. 29

    What's actually happening when I convert an int to a string?

HotTag

Archive