# Javascript IF statement with multiple conditions



## gamerman0203

I don't know if I'm having a brain malfunction or if there really isn't a way to do it. I want to make an IF statement that triggers on multiple conditions.

ie. IF (condition 1 is true) and (condition 2 is true) {
action
}

Is there a way? If not through an "IF" statement, then any suggestions?

thanks!


----------



## MoralTerror

Use the logical operator &&

eg


Code:


 if (condition1 && condition2) {action}


----------



## gamerman0203

I don't know if I tried that in that exact syntax.

Thanks!


----------

