chained comparisons don't work in node, a < b < c is equivalent to (a < b) < c, i.e. coerce the boolean (a < b) to an integer (0 for false, 1 for true) and then compare that to c. So this lts test would always have been true, since both 0 and 1 are less than +new Date(2020, 4, 31)
chained comparisons don't work in node,
a < b < c
is equivalent to(a < b) < c
, i.e. coerce the boolean(a < b)
to an integer (0 for false, 1 for true) and then compare that toc
. So thislts
test would always have beentrue
, since both0
and1
are less than+new Date(2020, 4, 31)