Sets every element of list to element, keeping its size.
list
element
Time: O(n).
The list.
The value for every position.
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] Copy
const list = new ArrayList([1, 2, 3])fill(list, 0) // list is now [0, 0, 0]
Sets every element of
listtoelement, keeping its size.Time: O(n).