javascript-collections-framework
    Preparing search index...

    Function fill

    • Sets every element of list to element, keeping its size.

      Time: O(n).

      Type Parameters

      • E

      Parameters

      • list: List<E>

        The list.

      • element: E

        The value for every position.

      Returns void

      TypeError when list is not a list from this library.

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