Quantcast
Channel: || ('OR') operator alternative - Stack Overflow
Viewing all articles
Browse latest Browse all 3

|| ('OR') operator alternative

$
0
0

I obviously got something terribly wrong here so I'll appreciate any good 'ol advice.How come that if I write

var x=''; var y="12345";(y.substring(0, 3) === "000"||"999") ? x=1: x=0;console.log (x, y.substring(0, 3));

The answer would be 1 "123"instead of 0 "123"?

Thanks y'all!


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images