142
rated 0 times
[
145]
[
3]
/ answers: 1 / hits: 9168
/ 10 Years ago, wed, april 9, 2014, 12:00:00
I have an if
test in JavaScript which achieves what I want but not as elegantly as possible. It goes like this:
if (x > y || p < q) {
// don't do anything
} else {
doSomeFunction();
}
If there any way to flip the logic of this so there's only a single if
statement without having to have a dummy if-condition as well as the else
condition?
More From » if-statement