code: function(p) {
  
              if (!p) return false;
  
              var segments = this.segments;
              var otherSegments = p.segments;
  
              var numSegments = segments.length;
              if (otherSegments.length !== numSegments) return false; // if the two paths have different number of segments, they cannot be equal
  
              for (var i = 0; i < numSegments; i++) {
  
                  var segment = segments[i];
                  var otherSegment = otherSegments[i];
  
                  // as soon as an inequality is found in segments, return false
                  if ((segment.type !== otherSegment.type) || (!segment.equals(otherSegment))) return false;
              }
  
              // if no inequality found in segments, return true
              return true;
          }
docs: Checks whether two paths are exactly the same. If `p` is undefined or null, returns false.