Skip to main content

Home > @jsplumbtoolkit/core > Path > each

Path.each() method#

Iterates through the path one step at a time. Each step consists of an object containing a vertex, and, for all entries except the first, an edge member, which supplies the Edge that links to the Vertex (which is why it is null for the first entry).

Signature:

each(fn: (i: number, p: ShortestPathComponent) => any): void;

Parameters#

ParameterTypeDescription
fn(i: number, p: ShortestPathComponent) => anyFunction to call for each step.

Returns:

void