Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialCynthia Norwood
Front End Web Development Techdegree Graduate 15,214 PointsLocal storage not saving search
Here is the snapshot, I checked the code against this workshop but I don't see any errors. Error in console is (index):81 Uncaught TypeError: recentSearches.forEach is not a function at window.onload ((index):81) https://w.trhou.se/az5r8qtzoc
3 Answers
Cynthia Norwood
Front End Web Development Techdegree Graduate 15,214 PointsAhhh I got it guys, I had to run a command in the console to clear the localStorage. Thanks All!
Haley Bengtson
Front End Web Development Techdegree Student 14,334 PointsThanks for posting your comment here because I was having the same problem with my browser. I cleared localStorage and it was finally working!
Steven Parker
231,275 PointsI was also unable to replicate the issue, but I did notice the "clear" function wasn't working:
localStorage.removeItem('removeSearches'); // you probably meant 'recentSearches' here
Cynthia Norwood
Front End Web Development Techdegree Graduate 15,214 PointsThanks Haley Bengston!!
Amber Cyr
19,699 PointsAmber Cyr
19,699 PointsI forked your snapshot, and I am not getting any console errors; everything seems to be working ok. What chain of events caused this error that you are seeing?