forEachSegment(callback) {
    return forEachSegment(
      this.flatCoordinates,
      0,
      this.flatCoordinates.length,
      this.stride,
      callback,
    );
  }
Iterate over each segment, calling the provided callback.
If the callback returns a truthy value the function returns that
value immediately. Otherwise the function returns `false`.

@param {function(this: S, import("../coordinate.js").Coordinate, import("../coordinate.js").Coordinate): T} callback Function
    called for each segment. The function will receive two arguments, the start and end coordinates of the segment.
@return {T|boolean} Value.
@template T,S
@api