The Range.compareBoundaryPoints() method compares the boundary points of the Range with those of another range.
Range.compareBoundaryPoints()
external int compareBoundaryPoints( int how, Range sourceRange, );