Jammming step 55 playlist removal doesn't work


Hi !
I’ve been plugging away at the Jammming project. I’ve gotten up to step 55 but my removals aren’t working. I’ve put it in a public repository on github .

Thanks! :slight_smile:


Double check this method in your App.js file and consider what you think the value of pTracks is after each step:

  removeTrack(track) {
    let pTracks = this.state.playlistTracks;
    pTracks.filter(currentTrack => currentTrack.id !== track.id );
    this.setState({playlistTracks: pTracks});
Click for another hint

The .filter() method returns a new array - it doesn’t change the array it was invoked from in-place. The pTracks array still contains all of the tracks after the .filter();

I didn’t dig any further after I spotted the issue mentioned above, If it still doesn’t work after you fix that, then my normal troubleshooting strategy would be to add some logging in each method that should be called just to be sure they are being called.

what a hero thanks!
I changed it so that pTracks was assigned to the filter method’s returned array and voila!