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


Groups > comp.lang.javascript > #24057

Re: Date false

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Date false
Date 2014-05-09 11:01 +0200
Organization PointedEars Software (PES)
Message-ID <4029002.xjOkqY7oij@PointedEars.de> (permalink)
References <1JidnUNwV7viyvHOnZ2dnUVZ_t6dnZ2d@westnet.com.au> <falsy-date-20140509065812@ram.dialup.fu-berlin.de>

Show all headers | View raw


Stefan Ram wrote:

> Andrew Poulos <ap_prog@hotmail.com> writes:
>> Can a date be false?
> 
>   The six falsy values are:
> 
>       undefined
>       null
>       NaN
>       0
>       ""
>       false

Which is irrelevant here as the value is not likely to be of the type of one 
of these values, given its string representation that was posted.
 
>>if (d) {
>>   // 'do something'
>>}
>>even when
>>   window.alert(d +" + "+ (typeof d));
>>displays
>>   Thu May 14 00:00:00 UTC 1000 2015 + date
>>'do something' never happens.
> 
>   If you write it behind »//«, then 'do something' is part
>   of a comment, and comments never happen.

Oh for crying out loud … please adjust your posting parser.  He *quite* 
*obviously* used the comment to replace code that he thought would not be 
relevant here.  And he was right.
 
>   The error might be in some part not shown in your post.

There is no error.

>   Maybe you can prepare an SSCCE.

Maybe you can learn to read or go away.
 
> var d = new Date( 2015, 4, 14 ); if( d )document.writeln( d );

…

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

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


Thread

Date false Andrew Poulos <ap_prog@hotmail.com> - 2014-05-09 14:18 +1000
  Re: Date false Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-09 10:46 +0200
  Re: Date false "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-05-09 10:58 +0200
  Re: Date false Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-09 11:01 +0200
  Re: Date false Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-05-09 17:27 -0300
    Re: Date false Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-05-09 17:32 -0300
    Re: Date false Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-10 10:36 +0200
  Re: Date false Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-05-09 18:05 -0300

csiph-web