array.copyWithin (target, start, end)
target: It represents the index position where the elements will copied. It is Required.
start: It represents the index position to start copying elements from. Default is 0. It is optional.
end: It represents the index position to end copying elements. Default is array.length. It is optional.
<!DOCTYPE html> <html> <head> </head> <body> <script> var a = ["GOLD","SILVER","DIAMOND","RUBY","PLATINUM"] var result = a.copyWithin(1,2,4); document.writeln(result); </script> </body> </html>