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

Function deleteNote

assets/js/note-app.js:150–164  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

148
149// this function will delete note, and show remaining notes.
150function deleteNote(index){
151 let notes = localStorage.getItem('notes');
152 let notesObj;
153
154 if(notes == null){
155 notesObj = [];
156 }
157 else{
158 notesObj = JSON.parse(notes);
159 }
160 // splice will remove element from index, here splice(index from where it should be remove, howmany element shoudl be remove)
161 notesObj.splice(index, 1);
162 localStorage.setItem('notes', JSON.stringify(notesObj));
163 showNotes();
164}
165
166let search = document.getElementById('searchTxt');
167

Callers

nothing calls this directly

Calls 2

stringifyMethod · 0.80
showNotesFunction · 0.70

Tested by

no test coverage detected