How to recreate the bug:
It seems that when addNotesFromLocalStorage function called, it checks the size of the notes, then starts to iterate starting from index 0. If the first note under such index is deleted and the first id is now 1, it will give an undefined error because there is no element under id = 0;