code: function() {
  
              var segments = this.segments;
              var numSegments = segments.length;
              // works even if path has no segments
  
              var path = new Path();
              for (var i = 0; i < numSegments; i++) {
  
                  var segment = segments[i].clone();
                  path.appendSegment(segment);
              }
  
              return path;
          }
docs: Returns a new path that is a clone of this path.