Tweakr
    Preparing search index...

    Function reverse

    • Creates a new array with the elements in reverse order.

      Type Parameters

      • T

      Parameters

      • array: T[]

        The array to reverse.

      Returns T[]

      A new array with the elements reversed. The original array is not modified.

      reverse([1, 2, 3]);
      // → [3, 2, 1]

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

      1.0.0