Javascript "And"s. How to?

Bluevoss
18 Aug 2018, 20:21

I've got some javascript, something in a local function like

    if (a==1){

and I've just realized I need to see what B is doing, too. So now it needs to be something like...

    if((a==1) and (b==1)){

Something like that. That works.

Ideas?


R2T1
19 Aug 2018, 10:51

try using && instead of and.
if((a==1) && (b==1)){


Bluevoss
20 Aug 2018, 02:27

Many thanks. I think that got it. Not sure about the inner parens - I left mine off but it seems to work.

Whew - this saved me all sorts of tangles!