Documentation
    Preparing search index...

    Function intersperse

    • Inserts a value between each element of a list. separator can be a function, which is useful to generate JSX elements with different keys.

      Type Parameters

      • Value
      • Separator

      Parameters

      • list: Value[]

        The list

      • separator: Separator | ((index: number) => Separator)

        The value to insert between each element of the list, or a function that will produce each element to insert.

      Returns (Value | Separator)[]