Build a Bookmark Manager App - Build a Bookmark Manager App

Tell us what’s happening:

Please help, I am on the last one and I no longer recognize where I have went wrong. I also tried the removeItem method but it didn’t work either

Your code so far

/* file: script.js */

 deleteBookmarkBtn.addEventListener('click', ()=>{
   
 const checkedBM =  categoryList.querySelector("input:checked");

const bookmarks = getBookmarks();
if(!checkedBM){
  return;
}else{
const newBookMark = bookmarks.filter( bookmark=> bookmark.name &&bookmark.category === checkedBM.name && checkedBM.category);
localStorage.setItem('bookmarks',JSON.stringify(newBookMark));
  renderBookmarks();
}

 })

<!-- file: index.html -->

/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36

Challenge Information:

Build a Bookmark Manager App - Build a Bookmark Manager App

Hi there,

The syntax for this condition is not valid. Expressions on each side of the && will be evaluated separately, so you’re basically saying:

if 
bookmark.name 
&&
bookmark.category === checkedBM.name
&& 
checkedBM.category

bookmark.name and checkBM.category will always be truthy if they are not an empty string.

Happy coding!

I still do not understand because when I do this, it still does not pass “bookmark.name === checkedBM.value)

Maybe you need to do some debugging inside that function using console.log() to see if you are getting the values you expect.