-using simple array, notes as json data added to a file and also checked if the file has duplicate notes or not
-modified previous version of code with re-usable functions and in a proper way to handle error messages
-remove a single note funtion - understanding this function, here (note) is not any variable or anything else, it defines individual items in the array:
var filteredNotes = notes.filter((note) => note.title != title);
var filteredNotes = notes.filter((note) => note.title != title);
is same as: var filteredNotes = notes.filter((note) => { return note.title != title; });
-need to get used to this: the first variable returns a boolean(true or false), the next is taking some decisions depending on that boolean.
var noteRemoved = notes.removeNote(argv.title);
var message = noteRemoved ? 'Note was Removed' : 'Note not found';