কম্পিউটার টিউটোরিয়াল

জাভাস্ক্রিপ্টে TypedArray.values() ফাংশন


TypedArray-এর values() ফাংশন একটি ইটারেটর অবজেক্ট রিটার্ন করে যেটি টাইপড অ্যারের ভ্যালুগুলো ধারণ করে। next() মেথড ইটেরেটর অবজেক্টের পরবর্তী এলিমেন্ট রিটার্ন করে।

সিনট্যাক্স

এইর সিনট্যাক্স নিচের মতো −

typedArray.values()

উদাহরণ

<html> <head>    <title>JavaScript Example</title> </head> <body>    <script type="text/javascript">       var typedArray = new Int32Array([11, 5, 13, 4, 15, 3, 17, 2, 19, 8 ]);       var iterator = typedArray.values();       document.write("Contents of the typed array: ");       for(i=0; i<typedArray.length; i++) {          document.writeln(iterator.next().value);       }    </script> </body> </html>

আউটপুট

Contents of the typed array: 11 5 13 4 15 3 17 2 19 8

  1. জাভাস্ক্রিপ্টে TypedArray.slice() ফাংশন

  2. জাভাস্ক্রিপ্টে TypedArray.set() ফাংশন

  3. জাভাস্ক্রিপ্টে TypedArray.reverse() ফাংশন

  4. জাভাস্ক্রিপ্ট array.values() মেথড