Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <2476103.KEgCaNTNbC@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sat, 22 Feb 2014 11:27:22 +0100 User-Agent: KNode/4.11.5 Content-Transfer-Encoding: 7Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <3506285.IpskKQNfjB@PointedEars.de> MIME-Version: 1.0 Lines: 32 NNTP-Posting-Date: 22 Feb 2014 11:27:24 CET NNTP-Posting-Host: 1d664edc.newsspool1.arcor-online.net X-Trace: DXC=nK>PR8Pd4^==FQB?mjjV50ic==]BZ:af>4Fo<]lROoR1nkgeX?EC@@059mb1gI=;^9DZm8W4\YJN8ZdD_1a;V8M0hG;?f`nZ4 X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:23193 Evertjan. wrote: > Thomas 'PointedEars' Lahn wrote on 22 feb 2014 in > comp.lang.javascript: It's attribution _line_, not attribution *novel*. >> if (!e) e = window.event; >> >> so that the assignment only takes place when necessary. > > e || window.event > > will do fine. > > I [most probably] all applications, > window.event will only be called if e does convert to false. 1. Nothing will be *called* here. 2. That is beside the point; the *assignment* will take place this way even if not necessary. 3. If a less simple test is necessary (for example, in order to prevent conversion to boolean), the now simple expression will quickly become unreadable, and hard to maintain. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.