Home » JavaScript TypedArray entries() Method

JavaScript TypedArray entries() Method

by Online Tutorials Library

JavaScript TypedArray entries() Method

This method returns a new Array Iterator object that contains key/value pairs for each index in the array. For all item in the original array, the new iteration object will have an array with the index as the key and the item as the value.

What is Iterator?

An iterator is an object that have track of its current position, while accessing items in a collection one at a time.

An iterator returns an object with two properties: key and value.

Syntax:

Parameters:

No parameters.

Return value:

A new Array Iterator object.

Browser Support:

Chrome 38
Edge Yes
Firefox 28
Opera No

Example 1

Test it Now

Output:

[0, 'tutorAspire']  [1,'Core java']  

Example 2

Test it Now

Output:

 [0, 'core Java']   [1, 'Python']  [2, 'Android']    

You may also like