JavaScript Storage key() Method
JavaScript Storage key() Method
The key() method is used to return the name of the key with the specified index. It is a very important method of the Storage Object. The Storage Object is either a localStorage object or a sessionStorrage object.
Syntax:-
Its syntax is:- localStorage.key(index) OR sessionStorage.key(index)
Further Explanation:-
Parameter | Description |
---|---|
index | Required. A number representing the index of the key. |