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
Post a Comment