Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #24064
| From | Joao Rodrigues <groups_jr-1@yahoo.com.br> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Date false |
| Date | 2014-05-09 17:32 -0300 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <lkje0o$sar$1@speranza.aioe.org> (permalink) |
| References | <1JidnUNwV7viyvHOnZ2dnUVZ_t6dnZ2d@westnet.com.au> <falsy-date-20140509065812@ram.dialup.fu-berlin.de> <lkjdnp$rfg$1@speranza.aioe.org> |
Em 09/05/2014 17:27, Joao Rodrigues escreveu:
> Em 09/05/2014 02:02, Stefan Ram escreveu:
>> Andrew Poulos <ap_prog@hotmail.com> writes:
>>> Can a date be false?
>>
>> The six falsy values are:
>>
>> undefined
>> null
>> NaN
>> 0
>> ""
>> false
>>
>
> There are seven "falsy" values indeed: false, +0, -0, "", NaN, null, and
> undefined, according to ES 5.1, § 9.2 (ToBoolean):
> <http://ecma-international.org/ecma-262/5.1/#sec-9.2>
>
>>> 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.
>
> "\\" was a comment by the OP.
>
>
Oops, "//" was a comment, not "\\".
--
Joao Rodrigues (J.R.)
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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