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

Function clearItems

assets/js/localstorage.js:88–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86
87// clear items
88function clearItems() {
89 const items = document.querySelectorAll(".grocery-item");
90 if (items.length > 0) {
91 items.forEach(function (item) {
92 list.removeChild(item);
93 });
94 }
95 container.classList.remove("show-container");
96 displayAlert("empty list", "danger");
97 setBackToDefault();
98 localStorage.removeItem("list");
99}
100
101// delete item
102

Callers

nothing calls this directly

Calls 2

displayAlertFunction · 0.85
setBackToDefaultFunction · 0.85

Tested by

no test coverage detected