copyWithin()
The copyWithin() method of Array instances shallow copies part of this array to another location in the same array and returns this array without modifying its length.
copyWithin(target, start)
copyWithin(target, start, end)
target:
Zero-based index at which to copy the sequence to, converted to an integer. This corresponds to where the element at start will be copied to, and all elements between start and end are copied to succeeding indices.
start
Zero-based index at which to start copying elements from, converted to an integer.
end Optional
Zero-based index at which to end copying elements from, converted to an integer. copyWithin() copies up to but not including end .
Example copyWithin(target, start)
<html>
<body>
<script>
const fruits = ["Zeroth", "First", "Second", "Third"];
console.log |