3 ms·
> Avoid giving the initial capacity to the array This isn’t necessarily right. It’s perfectly fine to do: Array(n).fill() Which returns a dense array.
by eyelidlessness 5y ago
> Avoid giving the initial capacity to the array
This isn’t necessarily right. It’s perfectly fine to do:
Array(n).fill()
Which returns a dense array.
- rasz 5y agoIt performs a copy, does nothing to the initial array.