Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: What's wrong with this code? Date: Thu, 26 Feb 2015 12:17:01 +0100 Organization: PointedEars Software (PES) Lines: 19 Message-ID: <1462385.MiWHP334DG@PointedEars.de> References: Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1424949501 14811 eJwVycERACEIBLCWwGURykGF/ku4uXxDuPrd5nTjcKDz3lEppKb1Xu1c8X9TatWFHAENzpyQ+AAMrxAM (26 Feb 2015 11:18:21 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 26 Feb 2015 11:18:21 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwFwQEBwCAMAzBLh7bbkAOM+pfwRIgRNxkKynIx90RuPIrAsnkLa2qZLvS74HqiBhvsUS2PZp55/DnyBzShFPA= Cancel-Lock: sha1:idR4aeAjKRY0lKv2XhpUiabLIrg= X-NNTP-Posting-Host: eJwNyckBwDAIA7CVWgwmjEM49h+h1VcGvixXGtXWthM3Zl0EcfKxg3adnasZbsQIg4Vm1crfHyGgERg= Xref: csiph.com comp.lang.javascript:26936 Stefan Ram wrote: > denissavenok@gmail.com writes: >> var isUndefinedOrNull = function(obj) { >> return /^(?:undefined|null)$/.test(typeof obj); >> }; > > // This stands since the beginning of JavaScript > typeof null === 'object'; Except that in the first JavaScript/JScript versions there was no “===” operator :) But using “==” instead does not change the semantics of this expression as the operands have the same type (String). -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.