Using Vanilla Javascript, I need to write a script that console logs an array of every unique page path visited during a browser session.
I am trying to do local storage and set the key with the current pathname. The part that I am getting suck on is pushing another value to that key in local storage.
So far I've gotten
localStorage.setItem('path', window.location.pathname);
But when I re-run that code it overwrites what I had already saved.
Where am I going wrong?