Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #36486
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: JSLint Unexpected Warning |
| Date | 2019-04-29 11:04 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <j0fece17bqm0ppk72sik45grh8ea8tdb89@4ax.com> (permalink) |
| References | <3c87329c-6f62-4dc0-a26b-3fb6ed10b04e@googlegroups.com> <XnsAA3CB44E3667Deejj99@194.109.6.166> <5ch4ce5kt6uq7telfompcjoe79c4ng4etl@4ax.com> <XnsAA3D8978E82F8eejj99@194.109.6.166> |
On Fri, 26 Apr 2019 13:30:50 +0200, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:
>Gene Wirchenko <genew@telus.net> wrote on 26 Apr 2019 in
>comp.lang.javascript:
>
>>>btw:
>>>
>>>if (myBoolean)
>>> return false
>>>else
>>> return true;
>>>
>>>is a unnecesarily difficult way of writing:
>>>
>>>return ! myBoolean;
>>
>> Quite. You might need parens around the boolean if it is an
>> expression.
>
>Why?
If the expression has more than one part, the negation will not
give the right result. Suppose the boolean is
IsCust && HasCredit
The negation is not
!IsCust && HasCredit
but
!(IsCust && HasCredit)
Sincerely,
Gene Wirchenko
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
JSLint Unexpected Warning emfril@gmail.com - 2019-04-25 01:28 -0700
Re: JSLint Unexpected Warning "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-04-25 04:33 -0700
Re: JSLint Unexpected Warning Julio Di Egidio <julio@diegidio.name> - 2019-05-16 20:13 -0700
Re: JSLint Unexpected Warning "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-05-18 10:59 -0700
Re: JSLint Unexpected Warning "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-04-25 17:43 +0200
Re: JSLint Unexpected Warning Gene Wirchenko <genew@telus.net> - 2019-04-25 16:43 -0700
Re: JSLint Unexpected Warning "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-04-26 13:30 +0200
Re: JSLint Unexpected Warning Gene Wirchenko <genew@telus.net> - 2019-04-29 11:04 -0700
Re: JSLint Unexpected Warning "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-04-30 00:06 +0200
Re: JSLint Unexpected Warning Gene Wirchenko <genew@telus.net> - 2019-04-30 21:15 -0700
Re: JSLint Unexpected Warning emf <emfril@gmail.com> - 2019-05-16 22:31 -0400
Re: JSLint Unexpected Warning Julio Di Egidio <julio@diegidio.name> - 2019-05-16 20:08 -0700
Re: JSLint Unexpected Warning Julio Di Egidio <julio@diegidio.name> - 2019-05-16 20:38 -0700
Re: JSLint Unexpected Warning Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-05-17 12:17 +0000
csiph-web