copyWithin(target); //target where to copy the sequence to
copyWithin(target, start); //copy to index target all elems at index start to end
copyWithin(target, start, end); //copy to index of target elem at index of start
// The copyWithin() method copies array elements to another position in the array.
// The copyWithin() method overwrites the existing values.
// The copyWithin() method does not add items to the array.
Syntax
array.copyWithin(target, start, end)
const fruits = ["Banana", "Orange", "Apple", "Mango", "Kiwi", "Papaya"];
console.log(fruits.copyWithin(2, 0, 2)); // Banana,Orange,Banana,Orange,Kiwi,Papaya