Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #17973

Re: typeof and jslint

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> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
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+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: typeof and jslint
Newsgroups comp.lang.javascript
References <Ba2dnXXmp_MKKXXNnZ2dnUVZ_sydnZ2d@westnet.com.au>
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<]lROoRa8kF<OcfhCOkkVJJEDc\6YfDZm8W4\YJNlb@mF9jNikdeWWB88<dh9WeX=6>g@PKdBg
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.javascript:17973

Followups directed to: comp.lang.javascript

Show key headers only | View raw


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

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

typeof and jslint Andrew Poulos <ap_prog@hotmail.com> - 2013-01-06 10:17 +1100
  Re: typeof and jslint Luc Yen <luc@goal.tw> - 2013-01-05 15:40 -0800
    Re: typeof and jslint Andrew Poulos <ap_prog@hotmail.com> - 2013-01-06 11:04 +1100
      Re: typeof and jslint Luc Yen <luc@goal.tw> - 2013-01-05 16:33 -0800
  Re: typeof and jslint David Mark <dmark.cinsoft@gmail.com> - 2013-01-05 16:16 -0800
    Re: typeof and jslint Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-01-11 00:53 +0100
  Re: typeof and jslint Stefan Weiss <krewecherl@gmail.com> - 2013-01-06 01:21 +0100
  Re: typeof and jslint Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-01-06 01:21 +0100

csiph-web