-
-
Save parzibyte/777161a1494f51f8129bb23604306784 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Obtener todas las claves almacenadas | |
let claves = Object.keys(localStorage); | |
// Y por cada clave, ir obteniendo el valor de localStorage | |
claves.forEach(clave => { | |
console.log("Tengo una clave: ", clave); | |
let valor = localStorage.getItem(clave); | |
// Castearlo o convertirlo depende de ti | |
console.log("En esa clave el valor es:", valor); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment