English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript Array keys() Method

 JavaScript Array Object

The JavaScript array keys() method returns a new array iterator object that contains the keys of each index in the array.

Syntax:

array.keys()
var alpha = ['A', 'B', 'C', 'D', 'E'];
var iterator = alpha.keys();
Test See‹/›

Browser Compatibility

The numbers in the table specify the first browser version that fully supports the keys() method:

Method
keys()382825812

Technical Details

Return Value:A new array iterator object
JavaScript Version:ECMAScript 6

 JavaScript Array Object