Prefer:
// The complex logic has been encapsulated into
// a clearly named and easily tested helper.
const hasVeryComplexConditionOccurred = (isThis, isThat, isAnother) =>
isThis || (isThat && isAnother);
// Encapsulating the complex conditional logic
// enables the reader to focus on the WHAT of
// the code rather than the HOW.
if (hasVeryComplexConditionOccurred(isThis, isThat, isAnother)) {
// Handle the scenario
}
Instead of:
// It's much harder to determine what
// the domain-specific intent is when
// a conditional is inlined like this.
if (isThis || (isThat && isAnother)) {
// Handle the scenario
}
Rationale
As noted above, extracting a clear, domain-relevant named function to encapsulate the complex conditional logic serves the purposes of clarifying the semantics of the consumer. As an added bonus, testing the complex conditional logic becomes trivial since it has been isolated into a pure, standalone function.