To put it in simple words, if you use any operator ( () - grouping op.
or ! unary not ) on the function it becomes a "function expression",
as opposed to a "function statement".

A line that starts with the function operator is a function statement
(declaration).
By definition, a function declaration can not be self executed.

See here for more info:
https://developer.mozilla.org/en/JavaScript/Reference/Functions_and_function_scope

HTH,
~Y

On Sep 29, 1:18 pm, Lasse Reichstein <reichsteinatw...@gmail.com>
wrote:
> On Thu, Sep 29, 2011 at 2:17 AM, Jimmy Chan <jimmyhc...@gmail.com> wrote:
> > some claim the ! has better performance over ()
> >http://jsperf.com/bang-function
>
> > from
> >http://stackoverflow.com/questions/5827290/javascript-function-leadin...
>
> That difference seems to be below the noise level.
> In Chrome 16, Opera 11.51 and IE 9, the different approaches are about the
> same speed (with +/- being markedly slower in Chrome and Opera, probably
> due to actually doing the to-number conversion, hitting NaN and getting
> penalized for that by the FPU).
>
> Seehttp://jsperf.com/bang-function/2
> Always run the tests twice and take the second result. That ignores the
> warmup effect on the test suite itself that might otherwise affect earlier
> tests negatively.
>
> /L

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to