Array `copyWithin` - what's the point?
· ☕ 2 min read
You must have seen the copyWithin() method for an array, and surely wondered what it can do. copywithin copies elements from one position to another position in the same array.
(Just kidding about the wondering thing - no one ‘wonders’ today, they just Google).
1 2 3 4 const fruits = ["apple", "orange", "grapes", "banana"]; fruits.