TypedArray.copyWithin() ফাংশনটি টাইপড অ্যারে-এর একটি অংশ অন্য भागে কপি করে (সেই অ্যারেতেই)। এটি অ্যারের লেন্থ পরিবর্তন করে না।
সিনট্যাক্স
typedArray.copyWithin(target[, start[, end]])
উদাহরণ
<html> <head> <title>JavaScript Example</title> </head> <body> <script type="text/javascript"> var int32View = new Int32Array([21, 64, 89, 65, 33, 66, 87, 55]); document.write("Before: " + int32View); int32View.copyWithin(5, 0, 5); // target=5, copy from 0 to 4 document.write("<br>After: " + int32View); </script> </body> </html>
আউটপুট
Before: 21,64,89,65,33,66,87,55 After: 21,64,89,65,33,21,64,89
এন্ড প্যারামিটার বাদ দেওয়া
end বাদ দিলে অ্যারে শেষ পর্যন্ত কপি হয়।