You are viewing a single comment's thread from:

RE: Saving Notes to a JSON file: Day Six of "The Complete Node.js Developer Course"

in #javascript8 years ago (edited)

Eating exceptions like this is not a good idea, you never know if it was failure in the reading or something else.

I agree with this. Maybe you can try making it fail on purpose (trying to open a file that doesn't exist for example) and then console.log(e) so you can see what is returned. Normally when I catch errors I do console.log(e.stack), and it gives enough explanation of what happened.

Also, I learned how to use .filter() with your post and the further explanation that @kkomaz wrote.