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

Parens and functions

Expand Messages
  • Douglas Crockford
    When immediately invoking a function literal, parens must wrap the expression when it is used in the statement position because of an ambiguity in the grammar
    Message 1 of 1 , May 12, 2008
    View Source
    • 0 Attachment
      When immediately invoking a function literal, parens must wrap the
      expression when it is used in the statement position because of an
      ambiguity in the grammar with function statements. However, those
      parens are not required, and are best avoided, in all other positions.
      JSLint now warns when parens are used unnecessarily.
    Your message has been successfully submitted and would be delivered to recipients shortly.