or function

Can I use an or function in an if statement?

Something like this:

if(globals.gebruikersnaam == “” or globals.wachtwoord == “”)

I have tried this but it won’t work.
Any suggestions?

In JavaScript (and many other programming languages) an OR is written as: || (two pipe’s)

if(globals.gebruikersnaam == “” || globals.wachtwoord == “”)

&& is the symbol for a logical AND
and ! is used for NOT