javascript-collections-framework
    Preparing search index...

    Function reverse

    • Reverses the order of the elements of list in place. Elements are written with set, so open iterators and cursors stay valid and see the new order.

      Time: O(n).

      Parameters

      • list: List<unknown>

        The list to reverse.

      Returns void

      TypeError when list is not a list from this library.

      const list = new ArrayList([1, 2, 3])
      reverse(list) // list is now [3, 2, 1]