другой способ для Loop JS

    let archive = [],
        keys = Object.keys(localStorage),
        i = 0, key; // defining multiple variables with let ..., ..., ...;
    // key = null => initial value of key
    // keys[i] => iterating through the keys array.
	// when you reach keys[i] = key (null), then stop. End of array
    // keys[12] = key = null
    
    for (; key = keys[i]; i++) {
        //  archive.push( key + '=' + localStorage.getItem(key));
        //CREATING array of OBJECT
        archive.push({keysalvato: key, valuesalvato: localStorage.getItem(key)})
    }
Ill Iguana