🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #51607

Re: Operator ||

#51607
From: nkab
Date: Fri, 20 Nov 2015 07:54
22 lines
2495 bytes
W dniu czwartek, 19 listopada 2015 14:27:26 UTC+1 użytkownik zpksoft napisał:
> W dniu czwartek, 19 listopada 2015 10:55:22 UTC+1 użytkownik nk...@toya.net.pl napisał:
> ...> 
> > a=0;
> > //var a;                  // undefined
> > b=100;
> > 
> > //alert(''+Boolean(a));
> > alert('ok...'+(a||b));    // 100
> > 
> > Andrzej.
> 
> Ale gdy a!=0 to zwróci a. Bo odpowiednikiem wartości boolean==false są 0, null, undefined itp.
> 
> Paweł

Ale tu, w przykładzie pytającego, najbardziej istotna była kwestia
co zwróci warunek, bo wyglądał na bardzo enigmatyczny, a po podłożeniu
cyferek wszystko stało się jasne, zaś dyskusja nie pozostawiła pytającemu
już żadnych wątpliwości o czym pewnie się dowiemy (albo nie).

Andrzej.
Technical Details
Message-ID: <3665d8ab-bf88-47dc-a166-8aa15870c2a2@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!enother.net!enother.net!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!b51no945952qgf.0!news-out.google.com!f23ni84qge.0!nntp.google.com!f78no945792qge.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <8c1d2c90-f115-4a39-b7f2-946ba4cd634a@googlegroups.com> <66995a5a-40f9-47b3-b75c-e69da8b2f137@googlegroups.com> <5f30c$564c40c9$6def49cc$17088@nntpswitch.blueworldhosting.com> <7216a2c7-5a5a-4d25-bd92-fedcc767a8b4@googlegroups.com> <31b156e9-661f-42a8-b716-acd48154d09c@googlegroups.com> <c6aafdad-68c7-4bcd-8979-45561f1024c4@googlegroups.com> <42ebcda8-496d-4442-a54e-2d77e8c0b9f1@googlegroups.com>

Show Full Headers
Complete Article Headers
X-Received: by 10.129.145.67 with SMTP id i64mr10204269ywg.31.1448006050367;        Thu, 19 Nov 2015 23:54:10 -0800 (PST)
X-Received: by 10.140.43.135 with SMTP id e7mr245267qga.13.1448006050323; Thu, 19 Nov 2015 23:54:10 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!enother.net!enother.net!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!b51no945952qgf.0!news-out.google.com!f23ni84qge.0!nntp.google.com!f78no945792qge.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.javascript
Date: Thu, 19 Nov 2015 23:54:10 -0800 (PST)
In-Reply-To: <42ebcda8-496d-4442-a54e-2d77e8c0b9f1@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=31.182.92.26; posting-account=xnOwqAoAAAAJ48pUkVrL2a6sJByqdB8s
NNTP-Posting-Host: 31.182.92.26
References: <8c1d2c90-f115-4a39-b7f2-946ba4cd634a@googlegroups.com> <66995a5a-40f9-47b3-b75c-e69da8b2f137@googlegroups.com> <5f30c$564c40c9$6def49cc$17088@nntpswitch.blueworldhosting.com> <7216a2c7-5a5a-4d25-bd92-fedcc767a8b4@googlegroups.com> <31b156e9-661f-42a8-b716-acd48154d09c@googlegroups.com> <c6aafdad-68c7-4bcd-8979-45561f1024c4@googlegroups.com> <42ebcda8-496d-4442-a54e-2d77e8c0b9f1@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3665d8ab-bf88-47dc-a166-8aa15870c2a2@googlegroups.com>
Subject: Re: Operator ||
From: nkab@toya.net.pl
Injection-Date: Fri, 20 Nov 2015 07:54:10 +0000
X-Received-Bytes: 2307
X-Received-Body-CRC: 1227347893
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit