actually no, but it help to keep consistency to add the parenthesis to the call. Because you are actually executing the function in your call.
On Dec 18, 2010, at 9:59 PM, Ezequiel wrote: > On Dec 17, 2:37 am, Juriy Zaytsev <kan...@gmail.com> wrote: >> var beget = (function() { >> function F(){ }; >> return function(o) { >> F.prototype = o; >> return new F; >> }; >> >> })(); >> > >> return new F; > > Are there any penalties for not including the parentheses when you're > invoking a constructor? > > ie. new F; versus new F(); > > Always wondered that. > > -- > 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 -- 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