function boxOverlaps(box1, box2) {
  const horizontalOverlap =
      rangeOverlap(box1.left, box1.right, box2.left, box2.right);
  const verticalOverlap =
      rangeOverlap(box1.top, box1.bottom, box2.top, box2.bottom);
  return horizontalOverlap != RangeOverlap.LEFT &&
      horizontalOverlap != RangeOverlap.RIGHT &&
      verticalOverlap != RangeOverlap.LEFT &&
      verticalOverlap != RangeOverlap.RIGHT;
}
Tells whether two boxes overlap.

@param {!Box} box1 First box in question.
@param {!Box} box2 Second box in question.
@return {boolean} Whether boxes overlap in any way.