<script>
// Constructing some new typedArrays
// with some elements
const A = new Uint8Array([ 5, 10, 15, 20, 25, 30, 35, 40 ]);
const B = new Uint8Array([ 5, 10, 15, 20, 25, 30, 35, 40 ]);
const C = new Uint8Array([ 5, 10, 15, 20, 25, 30, 35, 40 ]);
const D = new Uint8Array([ 5, 10, 15, 20, 25, 30, 35, 40 ]);
const E = new Uint8Array([ 5, 10, 15, 20, 25, 30, 35, 40 ]);
// Calling copyWithin function with different
// parameters
a = A.copyWithin(0, 5);
b = B.copyWithin(1, 4);
c = C.copyWithin(0, 4, 5);
d = D.copyWithin(2, 3, 5);
e = E.copyWithin(0, 1, 4);
// Printing new modified arrays
console.log(a);
console.log(b);
console.log(c);
console.log(d);
console.log(e);
</script>