Is there an operator that denotes a variable as both greater and lesser than? The following code block is not valid code.
JavaScript
x
if (0 < $variable < 5)
{
etc
}
Advertisement
Answer
No. You’d want to use an “AND” operator, &&
:
JavaScript
if ($variable > 0 && $variable < 5) {
// bla.. bla.. bla..
}