javascript - How to have multiple 'and' logical operators and an 'or' logical operator -


it hard explain want looks this:

if(a === 4 && b === true && c === "words" || "numbersandwords")dosomething(); 

but ends running without matching first operators. want know how have last operator except 2 different inputs while still making sure other criteria met before running.

you need use parentheses, e.g.:

if(a == 4 && b == true && (c == "words" || c == "numbersandwords")) { dosomething(); } 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -