Nesting if statements

Hi

if (1stcondition) {
  return "condition is true";
 if (2ndcondition) {
  return "second condition is true";
}} 

Does this code work the way I think it does?
If 1stcondition is true, it evaluates whether 2ndcondition is true? But it does not evaluate the 2nd condition if the 1st condition does not resolve to true. Am I correct or am I wrong?

2 posts were merged into an existing topic: Nesting if statements VS Elseif

Please do not create duplicate topics for the same challenge/project question(s). This duplicate topic has been unlisted.

Thank you.