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


Groups > comp.lang.javascript > #32401

Re: understanding the expression "ws && ~[2, 3].indexOf(ws.readyState)"

Newsgroups comp.lang.javascript
Subject Re: understanding the expression "ws && ~[2, 3].indexOf(ws.readyState)"
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <o6eo1r$ifl$1@shakotay.alphanet.ch> <878tpwzqct.fsf@bsb.me.uk> <o6fube$62g$1@shakotay.alphanet.ch>
Date 2017-01-28 10:41 +0100
Message-ID <XnsA70B6CBA8F9BCeejj99@194.109.6.166> (permalink)

Show all headers | View raw


=?UTF-8?Q?Une_B=c3=a9vue?= <unbewusst.sein@fai.invalid> wrote on 27 Jan 2017 
in comp.lang.javascript:

> Le 27/01/2017 … 12:36, Ben Bacarisse a ‚crit :
>> Any non-zero number (other than NaN) is considered to be true in a
>> Boolean context.

Please reconsider:

alert(0 == false) // true
alert(0 === false) // false

alert(17 == true) // false ???????????
alert(true == 17) // false ???????????
alert(!!17) // true
 
> ok, fine, it's what I expected.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


Thread

understanding the expression "ws && ~[2, 3].indexOf(ws.readyState)" Une Bévue <unbewusst.sein@fai.invalid> - 2017-01-27 07:06 +0100
  Re: understanding the expression "ws && ~[2, 3].indexOf(ws.readyState)" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-27 11:36 +0000
    Re: understanding the expression "ws && ~[2, 3].indexOf(ws.readyState)" Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-27 13:04 +0100
    Re: understanding the expression "ws && ~[2, 3].indexOf(ws.readyState)" Une Bévue <unbewusst.sein@fai.invalid> - 2017-01-27 18:00 +0100
      Re: understanding the expression "ws && ~[2, 3].indexOf(ws.readyState)" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-28 10:41 +0100
        Re: understanding the expression "ws && ~[2, 3].indexOf(ws.readyState)" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-28 15:33 +0000
    Re: understanding the expression "ws && ~[2, 3].indexOf(ws.readyState)" Une Bévue <unbewusst.sein@fai.invalid> - 2017-01-29 09:12 +0100

csiph-web