Path: csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: difference between "var resolve = function resolve() {...}" and "var resolve = function () {...}" ? Date: Wed, 20 Jul 2016 15:08:52 +0200 Organization: PointedEars Software (PES) Lines: 29 Message-ID: <1703874.PYKUYFuaPT@PointedEars.de> References: <1961081.iZASKD2KPV@PointedEars.de> <941fff3e-5d05-4648-ba43-51e9ceb3ca7d@googlegroups.com> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1469020133 31261 eJwFwYEBgDAIA7CXQIF154C0/59gkm95fScqK1KpKDQXWvRR0y+bTwTaizZayQZS4Bh5J38+hBJo (20 Jul 2016 13:08:53 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Wed, 20 Jul 2016 13:08:53 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwNyMEBwCAIA8CVQEiUcQRh/xHaex6MytpO0DEYjwj02TcWMoin/Y9g4RxuNiehW1SuZRUYWfl6xsXY1+wDKjYU+A== Cancel-Lock: sha1:eAsQ8I+MYKYirG8Mlk4QGrTSFdQ= X-NNTP-Posting-Host: eJwNwgERwDAIA0BLdECayOko+Jew3X86FmoHEpHzO8fGG64c6oFF8b2i8U6h5S1zUkurdqk/FscQzA== Xref: csiph.com comp.lang.javascript:30950 Michael Haufe (TNO) wrote: > […] Thomas 'PointedEars' Lahn wrote: >> Michael Haufe (TNO) wrote: >> > var resolve = function resolve(){...} >> > >> > This form is redundant. >> No, it is not. > > Correct in semantic details, but by "redundant" in this case I was using > the synonym: "useless". AISB, it is useless if and only if the function is not referred to from within its body. > I would also use the same word "redundant" if the code happened to be the > following: > > var foo = function bar(){ /* explicit example with no reference to bar */ > } It is still not useless if the function modifies the variable value but a reference to itself has to be kept (self-modifying code). -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.