Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!easy.in-chemnitz.de!news2.arglkargh.de!news.karotte.org!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <2177465.0Ca87JebjB@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sun, 06 Jan 2013 01:21:58 +0100 User-Agent: KNode/4.4.11 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+&. Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 28 NNTP-Posting-Date: 06 Jan 2013 01:21:59 CET NNTP-Posting-Host: 0c07b594.newsspool3.arcor-online.net X-Trace: DXC=mo:VUN3ZlVlUoRk[hk2WalMcF=Q^Z^V3h4Fo<]lROoRa8kFg@PKdBg X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:17973 Andrew Poulos wrote: > If I test the following with jslint > if (typeof num === 'undefined') { return false; } > > I get the error > Unexpected 'typeof'. Use '===' to compare directly with undefined. > > I'm not sure what its telling me. Is it saying that I should instead use > if (num === undefined) { return false; } > ? Probably, yes. > Why is tyepof unexpected? Because Douglas Crockford has some rather weird and purely subjective notions how these languages – that he misleads others to think of as a single one – should be written, and those notions are expressed and enforced by jslint. PointedEars -- var bugRiddenCrashPronePieceOfJunk = ( navigator.userAgent.indexOf('MSIE 5') != -1 && navigator.userAgent.indexOf('Mac') != -1 ) // Plone, register_function.js:16