• Traverses the target nodes with the given callback function

    Type Parameters

    • T

    Parameters

    • Optionalnodes: T[]

      the nodes to traverse

    • Optionalcallback: ((node: T, nodes?: T[]) => void)

      the function to execute during traversing

        • (node, nodes?): void
        • Parameters

          • node: T
          • Optionalnodes: T[]

          Returns void

    • childrenKey: string = 'children'

      the property name to children node

    Returns void