[solved] How can I use a conditionnal OR in a script?

Hello everyone. 👋

I'm trying to make an OR statement in a conditionnal branch with a script line.
I'm basically looking for the value of a variable, which could have several values.

The reason I'm doing this with a script and not with the regular variable conditons is that I'm looking for a string value, which can't be set other than by scripting.

So, here is how it looks :

JavaScript:
If: Script:$gameVariables.value(55) == "omg"||"omfg"

However, doing this will result in anything triggering this condition.
I tried enclosing the keywords with (); and tried an absolute === condition, but it doesn't do the trick.

I'm not an expert and I'm pretty sure a simple This OR That can be put in one script line, so could anyone help me with the correct syntax?

Thank you very much. 😤
The "or" gets evaluated before the "is equal": you need to do two separate "is equal" checks, e.g.
JavaScript:
$gameVariables.value(55) === "omg" || $gameVariables.value(55) === "omfg"
Alternatively you could do this by looping through an array (i.e. a list of values), e.g.
JavaScript:
["omg", "omfg"].includes($gameVariables.value(55))

You can find more info on Array#includes here in case you're interested:
Thanks alot, my bad for trying to skip on some code. ^^

JavaScript:
["omg", "omfg"].includes($gameVariables.value(55))

You can find more info on Array#includes here in case you're interested:
Very interesting indeed. 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-how-can-i-use-a-conditionnal-or-in-a-script.136031/