If AND statement

I am attempting to do a script to check the value of two different variables. To my understanding, it should work like this:

if (x === $gameVariables.value(1)) && (y === $gameVariables.value(1) {
//Do this
}

However, when I run the script, I get an error message saying "Syntax Error Unexpected Token &&". Am I not doing this right? I encounter the same issue when I use || for or.
Where and how exactly do you use this?
Can you give a Screenshot if it is inside any event command?

The error message doesn't always point to the correct Problem because the Computer places a message when he detects a problem, not always when it really happened...
I am using it to compare the positions of the player character and an enemy event, and want it to only activate a switch when they are in a certain position. The script is activated by the action button.
Screenshot.jpg
Your brackets aren't matching up. It should be:
Code:
if (x === $gameVariables.value(1) && y === $gameVariables.value(1)) {
  // do stuff
}

EDIT: More generally, the syntax is
Code:
if (CONDITION A && CONDITION B) {
// do stuff
}
That worked. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/if-and-statement.94001/