- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHPPhysics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
TypedArray.values() function in JavaScript
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
<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