Imagine a situation where you print something in the Console when clicking or following a link. When you navigate to another page, the Console is cleared and all the messages are lost.
Fortunately, both Chrome DevTools and Firefox Developer Tools give us options to persist the logs between page loads.
Under the Console panel of Chrome DevTools, click the cog icon on the right, and turn on the Preserve log option:
In addition to the logs of each page, DevTools also lets you know when you navigate to another page. It's easy for us to determine where a log message comes from.