DEV Community

Discussion on: 5 important JavaScript array methods

Collapse
 
paul_mountney_24e4867f3d3 profile image
Paul Mountney

The variable name is: filteredBooks, so i put that in the console log like you suggested, console.log(filteredBooks), hit enter and i got a bunch of error messages. What am i doing wrong?

Thread Thread
 
marlonry profile image
marlonry

😅 I would have to see the code to be able to help you.

Thread Thread
 
paul_mountney_24e4867f3d3 profile image
Paul Mountney

I figured it out, i was supposed to put the code:
const filteredBooks = books.filter(books => {
return books.writer === "Jeremiah";
});

console.log(filteredBooks)

at the end of my array, and i ran it through Nodejs

Thread Thread
 
marlonry profile image
marlonry

Awesome. Glad you got it!