DEV Community

Discussion on: "Elm Has Me Leaping For Joy"

hurstc profile image
Chris H • Edited on

Doesn't xor break for years divisible by 400?

xor true (true or true) -> xor true true -> false

Or am I reading this wrong

vincecampanale profile image
Vince Campanale Author • Edited on

You're correct. That's why the second half of the expression has || divisiblyBy 400 year. For a number divisible by 400, the first half evaluates to false, then the second half evaluates to true, false || true -> true, so we get true for years divisible by 400.