Getting a key by index in a localStorage in JavaScript

Each entry in the local storage has its own index. By index you can retrieve the key of this entry:

javascriptlet key = localStorage.key(0);
console.log(key);

Knowing the key, you can get the value of this entry:

javascriptlet key = localStorage.key(0);
let val = localStorage.getItem(key);

console.log(val);
Задание 1

Retrieve the value of entries with different indices.