This file contains hidden or 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
for (var key in object) { | |
// obj is the value assigned to the key in the object | |
var obj = object[key]; | |
console.log(obj); | |
} |
This file contains hidden or 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
// Guardar el array en el localStorage | |
// El arreglo: | |
var array = [1, 2, 3]; | |
// Se guarda en localStorage despues de JSON stringificarlo | |
localStorage.setItem('myArray', JSON.stringify(array)); | |
// Obtener el arreglo de localStorage | |
var array = localStorage.getItem('myArray'); |
This file contains hidden or 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
// Store an array in local storage | |
// The array to store | |
var array = [1, 2, 3]; | |
// Store after JSON stringifying (is this a verb?) it | |
localStorage.setItem('myArray', JSON.stringify(array)); | |
// Get an array from local storage | |
// Retrieve the array from local storage |