Skip to content
Advertisement

How to check the values of multiple variables at once?

I need to check the value of all 3 variables(username, password, secret). If a value is NA then I need to execute a print statement or else some condition needs to be executed.

JavaScript

Example

JavaScript

How to check the value of those variables all at once?

Advertisement

Answer

You could use the in operator to check whether a value is "NA". Like so:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement