Javascript – Function that delete a selected index for an array
function deleteClient(i) { let confirmation =""; notificationParent.classList.add("active"); notificationBtn.forEach((btn) => { btn.addEventListener("click", () => { confirmation = btn.dataset.content // ok or cancel if(confirmation == "ok"){ clientsArray.splice(i, 1); localStorage.Clients = JSON.stringify(clientsArray); notificationParent.classList.remove("active"); }else{ notificationParent.classList.remove("active"); } }) }) showClientsData(); } Each time I…