Jump to content

JavaScript if Else and question


ThomasBP
 Share

Recommended Posts

If only A is filled, it means that B has to not be filled.

The structure would like similar to the following, assuming A and B are booleans:

if(A && !B) {
  // Only A
} else if(B && !A) {
  // Only B
} else if(A && B) {
  // Both A and B
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...