You could defer the evaluation by collecting the values of the call.
And then look with Array#some
and Boolean
as callback if some value is truthy.
if ([checkPassword(), checkUserName()].some(Boolean)) {
// ...
}
0
solved How to write an if statement in Javascript?