Learn Basic String and Array Methods by Building a Music Player - Step 85

Tell us what’s happening:

Hello! I think I successfully removed the reset button from the playlist. However I am still being prompted to “remove the reset button from the DOM” I’m not sure how to rephrase the code to do this.

Your code so far


    resetButton.addEventListener("click", () => {
      userData.songs = [...allSongs];
      renderSongs(userData?.songs);
      setPlayButtonAccessibleText();
      remove(resetButton);
      
    });

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36

Challenge Information:

Learn Basic String and Array Methods by Building a Music Player - Step 85

What do the instructions say for this step - they normally tell you eaxctly how to do it

Here are the instructions:

Finally, you should render the songs again, update the play button’s accessible text, and remove the reset button from the playlist. You also need to remove the resetButton from the DOM.

Call the renderSongs() function with userData?.songs as an argument to render the songs again.

Call the setPlayButtonAccessibleText() function to update the play button’s accessible text.

Remove the reset button from the playlist by calling the remove() method on the resetButton variable.


Your issue is here

This is the incorrect syntax for the remove method

This is the basic syntax

element.remove()

you need to apply that to the resetButton to pass the tests

Mod edit: solution code removed

@Jap28

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.


As an aside:

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Understood po. I’m really sorry! Thank you for correction and advice

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.