Adding a variable condition in a plugin

I'd like to add a condition in a plugin like this:

If variable X = Y then

do this

else

do that

end

What is the correct syntax? And does "elsif" work for more than 2 cases?
I'd like to add a condition in a plugin like this:

If variable X = Y then

do this

else

do that

end

What is the correct syntax? And does "elsif" work for more than 2 cases?
Code:
let X = 5, Y = 6;
if ($gameVariable.value(X) === $gameVariable.value(Y)){
console.log("do this");
}else{
console.log("do that");
}

Code:
let X = 5, Y = 6;
if ($gameVariable.value(X) === $gameVariable.value(Y)){
  console.log("if... do this");
}else if ($gameVariable.value(X) > $gameVariable.value(Y)){
  console.log("else if... do this");
}else if ($gameVariable.value(X) < $gameVariable.value(Y)){
  console.log("else if... do this");
}else{
  console.log("else... do that"); // lol though this would never occur because every option possible is met above
}
More info:

You mean like that?
Thanks, it worked.
Thanks, it worked.
No prob. Glad I could assist.

Happy Game Making! 🙂
Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/adding-a-variable-condition-in-a-plugin.121416/