I saw a comparison like the following in a question on SO:
(pNum != ('2','3','4','5','6','7','8','9'))
The OP has been trying to check if a number falls in a certain range but this code is inaccurate as it will always compare with right most value inside the brace(i.e. 9)
This means when pNum = 2
the comparison will return true
and not false
as was expected by OP who was expecting it to work like inArray
or in
.
My question is whether this sort of comparison is going to be useful in any real case in any scenario?