If statement with two conditions?

I'm having trouble figuring this out; I want to have the following if statement, with two conditions, run only if both strings match. I know that || is OR, and && is and, so I've done the most logical thing and made both of the strings to be checked have an OR, so it can be any of the things, but both of the strings need to match to the things in the quotes. This is really confusing, also a new problem opens up, if I don't include the condition "unittwo" to be checked, then it works perfectly, the if statement will only run if "unitone" matches one of the multiple strings.

Also, I have both of them as strings, and know to put == instead of =.

 
  if ((unitone == "kg" || "kilograms" || "KG" || "Kg" || "kG" || "Kilograms") && (unittwo == "grams" || "g" || "G" || "Grams")) {
You need to rewrite the name of the variable for each check, like this:

if ( (unitone == "kg" || unitone == "kilograms" || unitone == "KG" || unitone == "Kg" || unitone == "kG" || unitone == "Kilograms") && (unittwo == "grams" || unittwo =="g" || unittwo == "G" || unittwo == "Grams") )
This works brilliantly, thanks.
Topic archived. No new replies allowed.