Tweakr
    Preparing search index...

    Function join

    • Joins all elements of an array into a string, separated by the specified separator.

      Type Parameters

      • T

      Parameters

      • array: T[]

        The array of elements to join.

      • separator: string = ","

        The string to separate each element. Defaults to a comma (",").

      Returns string

      A string with all array elements joined by the separator.

      join([1, 2, 3], "-");
      // → "1-2-3"

      join(["a", "b", "c"]);
      // → "a,b,c"

      1.0.0