TypedArray.forEach() ফাংশনটি টাইপড অ্যারে-এর প্রতিটি এলিমেন্টের জন্য একটি কলব্যাক ফাংশন এক্সিকিউট করে।
সিনট্যাক্স
typedArray.forEach(callbackFn[, thisArg])
উদাহরণ
<html> <head> <title>JavaScript TypedArray forEach</title> </head> <body> <script type="text/javascript"> var int32View = new Int32Array([21, 19, 65, 21, 14, 66, 87, 55]); document.write("Array: " + int32View); document.write("<br>Result: "); function add100(element) { document.write(element + 100 + " "); } int32View.forEach(add100); </script> </body> </html>
আউটপুট
Array: 21,19,65,21,14,66,87,55 Result: 121 119 165 121 114 166 187 155