[Solved] How to write OR in Javascript?

[ad_1]

Simply use:

if ( age == null || name == null ){    
    // do something    
}

Although, if you’re simply testing to see if the variables have a value (and so are ‘falsey’ rather than equal to null) you could use instead:

if ( !age || !name ){    
    // do something    
}

References:

[ad_2]

solved How to write OR in Javascript?