Description

This copies the elements whose indices are in the range [start,end) to index target and subsequent indices. If the two index ranges overlap, care is taken that all source elements are copied before they are overwritten. I am confused as to how this is in any way useful.

Syntax

Array.prototype.copyWithin(target : number,
    start : number, end = this.length) : This
const arr = [0,1,2,3];
console.log(arr.copyWithin(2, 0, 2)) // [0, 1, 0, 1]