Re: [JSMentors] Re: Function expression/statement

2011-02-16 Thread Sean Kinsey
On Wednesday, February 16, 2011 10:39:36 AM UTC+1, Fran wrote: > > That was a good article of Ben Alman... Just wanted to mention that after > doing some test I found out that using "new function" to immediately invoke > the function is rather slow compare to the other two patterns, up to 50% >

Re: [JSMentors] Re: Function expression/statement

2011-02-16 Thread Fran
That was a good article of Ben Alman... Just wanted to mention that after doing some test I found out that using "new function" to immediately invoke the function is rather slow compare to the other two patterns, up to 50% slower y some cases. (function () {}()); (function () {})(); new functi

Re: [JSMentors] Re: Function expression/statement

2011-02-16 Thread Nick Morgan
On 16 February 2011 05:16, RobG wrote: > > The main reason for using the grouping operator with functions that > are executed immediately is that it lets humans reading the code know > that when reading the first line of the function, as explained by > Peter Michaux: > > That's not *quite* right

[JSMentors] Re: Function expression/statement

2011-02-15 Thread RobG
On Feb 15, 7:12 pm, Peter van der Zee wrote: > On Tue, Feb 15, 2011 at 9:53 AM, Ivan S wrote: > > Hi all. > > > I don't know ECMA script specification so well, so if someone can explain > > what's the difference between this two: > > > (function() { > > > }()); > > > (function() { > > > })(); >