Consecutive IF statements in javascript
I am working on some code in Node.js. Basically I am trying to analyze and
apply logic on the query part of the URL. The abstract of my situation is
below:
If(condition1){run1};
If(condition2){run2};
else{run3};
When F-F (condition1-condition2) run3 happens When T-F run3 happens (run1
should've happened...) When F-T run2 happens When T-T run1 and run2 happen
I tried:
If(condition1){run1};
else{run4};
If(condition2){run2};
else{run3};
Where run4 is blank.
What is going on here? I want run1 to happen if condition1 is met, run to
happen if condition2 is met and both if both are met and none if none are
met.
TIA
No comments:
Post a Comment