Loading ...
Sorry, an error occurred while loading the content.

1020Re: [jslint] Invoke a function in an array or object

Expand Messages
  • Stefan Weiss
    Dec 14, 2009
      On 14/12/09 13:24, samckayak wrote:
      > When an array or object contains functions:
      > var aFunct=[];
      > aFunct[0]=fnMyFunction;
      > What are the pros and cons of invoking the function using either of the following:
      > aFunct[0]();
      > or
      > (aFunct[0])();

      Technically, both versions are correct, but since the parentheses around
      aFunct[0] are redundant, and there are no ambiguities in aFunct[0](), I
      can't see any advantage to the second version.
      Back on topic: JSLint is fine with both.

    • Show all 2 messages in this topic