Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.fsmpi.rwth-aachen.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <15066019.Edmlg4qf5b@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Mon, 20 May 2013 14:23:47 +0200 User-Agent: KNode/4.10.2 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. MIME-Version: 1.0 Lines: 38 NNTP-Posting-Date: 20 May 2013 14:25:31 CEST NNTP-Posting-Host: fa89d066.newsspool2.arcor-online.net X-Trace: DXC=fML_D=68cP`PXlQ;h]GTMdA9EHlD;3Ycb4Fo<]lROoRa8kF]gfnPm07ZT5g5Al X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:19841 Eric Bednarz wrote: > "Jukka K. Korpela" writes: >> the test >> >> typeof options.actor !== "undefined" >> >> is unnecessary complicated, since you can use >> >> options.action !== undefined > > This, however, is unnecessarily brittle since the undefined property of > the global object is writable in ES < 5. ACK. And in earlier implementations there was no “undefined” property, causing this to throw (the equivalent of) a ReferenceError. > It is also overly verbose. In what way? > options.action !== void 0; I would call *that* overly verbose. For backwards compatibility, I have occasionally declared var undefined; However, nowadays the “!==” and “===” operators and the “undefined” property of the Global Object can generally be considered safe language features. Only a caveat with the property value and host objects must remain for the time being. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.