Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

You're dead, Jim. -- McCoy, "Amok Time", stardate 3372.7


devel / comp.lang.javascript / Re: Simple question on boolean function return value

SubjectAuthor
* Simple question on boolean function return valueJanis Papanagnou
+* Re: Simple question on boolean function return valueStefan Ram
|`- Re: Simple question on boolean function return valueJanis Papanagnou
`- Re: Simple question on boolean function return valueV V V V V V V V V V V V V V V V V V

1
Simple question on boolean function return value

<tprrfh$4ve$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18015&group=comp.lang.javascript#18015

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!aioe.org!l0a7mbpMAnmInR5ez9Z/yg.user.46.165.242.75.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.javascript
Subject: Simple question on boolean function return value
Date: Fri, 13 Jan 2023 15:56:49 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tprrfh$4ve$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="5102"; posting-host="l0a7mbpMAnmInR5ez9Z/yg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
X-Notice: Filtered by postfilter v. 0.9.2
X-Enigmail-Draft-Status: N1110
X-Mozilla-News-Host: news://nntp.aioe.org:119
 by: Janis Papanagnou - Fri, 13 Jan 2023 14:56 UTC

Today I was surprised that some old code did not work as I'd have
expected:

function friday_13th (now)
{ return now.getDay()==5 && now.getDate==13;
}

That function returned 'false' and also putting parenthesis around
the (sub-) expressions did not help. I had to use a local variable
to make that work:

function friday_13th (now)
{ var f13 = now.getDay()==5 && now.getDate()==13;
return f13;
}

Can anyone explain that please?

Janis

Re: Simple question on boolean function return value

<pair-20230113160915@ram.dialup.fu-berlin.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18016&group=comp.lang.javascript#18016

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.javascript
Subject: Re: Simple question on boolean function return value
Date: 13 Jan 2023 15:09:54 GMT
Organization: Stefan Ram
Lines: 6
Expires: 1 Jan 2024 11:59:58 GMT
Message-ID: <pair-20230113160915@ram.dialup.fu-berlin.de>
References: <tprrfh$4ve$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de hiESMtPM/0BFLJDHfQFVaA4TI1jjAuvrk6SKFJprPJeMmQ
X-Copyright: (C) Copyright 2023 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Fri, 13 Jan 2023 15:09 UTC

Janis Papanagnou <janis_papanagnou@hotmail.com> writes:
>return now.getDay()==5 && now.getDate==13;

There is a pair of parentheses missing above.

Re: Simple question on boolean function return value

<tprt13$vkf$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18017&group=comp.lang.javascript#18017

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!aioe.org!l0a7mbpMAnmInR5ez9Z/yg.user.46.165.242.75.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.javascript
Subject: Re: Simple question on boolean function return value
Date: Fri, 13 Jan 2023 16:23:15 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tprt13$vkf$1@gioia.aioe.org>
References: <tprrfh$4ve$1@gioia.aioe.org>
<pair-20230113160915@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="32399"; posting-host="l0a7mbpMAnmInR5ez9Z/yg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
X-Notice: Filtered by postfilter v. 0.9.2
 by: Janis Papanagnou - Fri, 13 Jan 2023 15:23 UTC

On 13.01.2023 16:09, Stefan Ram wrote:
> Janis Papanagnou <janis_papanagnou@hotmail.com> writes:
>> return now.getDay()==5 && now.getDate==13;
>
> There is a pair of parentheses missing above.

Argh! - I had been looking so long at that code that I obviously
got "code-blind". - Thanks!

Janis

Re: Simple question on boolean function return value

<750ecf88-693a-4da4-891b-625a3375afc8n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18026&group=comp.lang.javascript#18026

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a17:90a:4ec6:b0:22b:faf7:7449 with SMTP id v6-20020a17090a4ec600b0022bfaf77449mr3046633pjl.151.1674925557752;
Sat, 28 Jan 2023 09:05:57 -0800 (PST)
X-Received: by 2002:a05:6870:204e:b0:163:4101:778a with SMTP id
l14-20020a056870204e00b001634101778amr1336537oad.160.1674925557290; Sat, 28
Jan 2023 09:05:57 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Sat, 28 Jan 2023 09:05:57 -0800 (PST)
In-Reply-To: <tprrfh$4ve$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=82.131.38.150; posting-account=ogslnwoAAACd9vU9PADzlWBA81fSuNpL
NNTP-Posting-Host: 82.131.38.150
References: <tprrfh$4ve$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <750ecf88-693a-4da4-891b-625a3375afc8n@googlegroups.com>
Subject: Re: Simple question on boolean function return value
From: vvvvvvvvaaaaaaaaaaaaaaa@mail.ee (V V V V V V V V V V V V V V V V V V)
Injection-Date: Sat, 28 Jan 2023 17:05:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1881
 by: V V V V V V V V V V - Sat, 28 Jan 2023 17:05 UTC

P i c t u r e , ⠀⠀⠀p a r d o n ?

On Friday, January 13, 2023 at 4:56:58 PM UTC+2, Janis wrote:
> Today I was surprised that some old code did not work as I'd have
> expected:
>
> function friday_13th (now)
> {
> return now.getDay()==5 && now.getDate==13;
> }
>
> That function returned 'false' and also putting parenthesis around
> the (sub-) expressions did not help. I had to use a local variable
> to make that work:
>
> function friday_13th (now)
> {
> var f13 = now.getDay()==5 && now.getDate()==13;
> return f13;
> }
>
> Can anyone explain that please?
>
> Janis

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor