Hello.
Thank you for this project.
Why don't you check the existence of the object even in edit mode?
It's possible that the updated item already exists, isn't it?
if (isEditMode) {
const itemToEdit = itemList.querySelector('.edit-mode');
removeItemFromStorage(itemToEdit.textContent);
itemToEdit.classList.remove('edit-mode');
itemToEdit.remove();
isEditMode = false;
} else {
if (checkIfItemExists(newItem)) {
alert('That item already exists!');
return;
}
}