Using the getAll function

In order to get started, all we need to do is fill out the list notes function, which in this case we called getAll. The getAll function is responsible for returning every single note. That means it's going to return an array of objects, an array of all of our notes.

All we have to do that is to return fetchNotes, as shown here:

var getAll = () => {  return fetchNotes();}

There's no need to filter, there's no need to manipulate the data, we just need to pass the data from fetchNotes back through getAll. Now that we have this in place, we can fill out the functionality over inside of app.js.

We have to create a variable where we can store the notes, I was going to call it notes, but I probably shouldn't because we ...

Get Learning Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.