Easy Tutorial
❮ Jsref Number Prop Style Borderwidth ❯

JavaScript keys() Method

JavaScript Array Object

Example

Create an array iterator object from the array fruit, which contains the keys of the array:

var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.keys();

Definition and Usage

The keys() method is used to create an iterable object containing the keys of the array.

Returns true if the object is an array, otherwise returns false.


Browser Support

The numbers in the table specify the first browser version that fully supports the method.

Method Chrome Edge Firefox IE Safari
keys() 38.0 12.0 28.0 8 25.0

Syntax

array.keys()

Parameters

No parameters.

Technical Details

Return Value: An array iterable object.
JavaScript Version: ECMAScript 6
--- ---

JavaScript Array Object

❮ Jsref Number Prop Style Borderwidth ❯