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
var addToLocalStorageArray = function (name, value) { | |
// Get the existing data | |
var existing = localStorage.getItem(name); | |
// If no existing data, create an array | |
// Otherwise, convert the localStorage string to an array | |
existing = existing ? existing.split(',') : []; | |
// Add new data to localStorage Array |