MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / editLocalStorage

Function editLocalStorage

assets/js/localstorage.js:165–175  ·  view source on GitHub ↗
(id, value)

Source from the content-addressed store, hash-verified

163 localStorage.setItem("list", JSON.stringify(items));
164}
165function editLocalStorage(id, value) {
166 let items = getLocalStorage();
167
168 items = items.map(function (item) {
169 if (item.id === id) {
170 item.value = value;
171 }
172 return item;
173 });
174 localStorage.setItem("list", JSON.stringify(items));
175}
176
177// SETUP LOCALSTORAGE.REMOVEITEM('LIST');
178

Callers 1

addItemFunction · 0.85

Calls 2

getLocalStorageFunction · 0.85
stringifyMethod · 0.80

Tested by

no test coverage detected