If a condition always evaluates to true or always evaluates to false, this often indicates incomplete code or a latent bug, and it should be examined carefully.

Examine the surrounding code to determine why the condition is redundant. If it is no longer needed, remove it.

If the check is needed to guard against NaN values, insert a comment explaining the possibility of NaN.

The following example finds the index of an element in a given slice of the array:

The condition i < end at the end is always false, however. The code can be clarified if the redundant condition is removed:

  • Mozilla Developer Network: Truthy, Falsy.