Path: csiph.com!au2pb.net!feeder.erje.net!1.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: How to manipulate integer that sometimes Nan and sometimes have a value? Date: Sat, 26 Sep 2015 17:19:17 +0200 Organization: PointedEars Software (PES) Lines: 21 Message-ID: <4175397.OLgykfH8RQ@PointedEars.de> References: <9060ce04-2f9e-4554-be83-2f69c213424f@googlegroups.com> <4f31ec16-109f-43b2-9d50-b39d4fb47f84@googlegroups.com> <3cf46737-de54-489e-9d9d-89413b18c099@googlegroups.com> <87wpvdec2d.fsf@bsb.me.uk> <64092fce-7ef7-48d7-9e0d-27a2220fcfe0@googlegroups.com> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: solani.org 1443280758 29596 eJwFwQkBgAAIA8BKDnnjAJP+Ebyz1+Eb6uZqZwfI04JS9rcqlNXLVVTxtpGzHJvkVQwD+AEhDhG2 (26 Sep 2015 15:19:18 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sat, 26 Sep 2015 15:19:18 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwFwYEBwCAIA7CXRGjFc6SM/09YAqdRJwgGBsO0p5aFf1knq2kPuO1vWe60ke+8MVpEX5ZqZWg3p4L68ANQvRWX Cancel-Lock: sha1:5wtj99WdFevY5v9AmObvBabJXDc= X-NNTP-Posting-Host: eJwFwYEBwCAIBLGVPOG/so5S9x/BRGF8vrScuroVY5jJxkSp6fGvaSsgaZdZ4tzKvTqbB+e5D3g= Xref: csiph.com comp.lang.javascript:28734 Evertjan. wrote: > What you probably mean is that the element may be > EITHER undefined > OR hold null OR a string OR an object. > > When testing with > > isNaN(element) > > it will return "true" because isNaN() returns true in all these cases. isNaN("42") === false isNaN({valueOf: function () { return 42; }}) === false isNaN({toString: function () { return "42"; }}) === false -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.