[TIL] JavaScript: How to update the URL without page reload

TIL that it's possible to programmatically set the URL in the browser's URL bar without having the browser try to load it.

This can be useful, for example in the context of a SPA, for updating the URL when a certain component is rendered or after a certain user action takes place, for analytics purposes (e.g., Google Tag Manager requires this for the History Change trigger):

window.history.replaceState(null, "", "/verified");

See more details in the documentation.