Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

1 Answer
Samual Sam

The values() function of the TypedArray returns an iterator object which holds the values of the typed array. The next() method returns the next element in the iterator object.

Syntax

Its Syntax is as follows

typedArray.values()

Example

Live Demo

<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>

Output

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

Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.