Function ergodic

  • 遍历数组

    Type Parameters

    • T

    Parameters

    • array: T[]

      要遍历的数组或对象树。

    • handle: ((item) => void)

      对每个元素执行的操作函数。

        • (item): void
        • Parameters

          • item: T

          Returns void

    • Optional options: {
          childrenKey?: string;
          deep?: number;
          mode?: "DFS" | "BFS";
      }

      可选参数对象,包含以下属性:

      • Optional childrenKey?: string

        对象树中子元素的键名,默认为 "children"。

      • Optional deep?: number

        遍历的深度,默认为 1。

      • Optional mode?: "DFS" | "BFS"

        遍历模式,支持深度优先搜索("DFS")和广度优先搜索("BFS"),默认为 "DFS"。

    Returns void

Generated using TypeDoc