Change the URL in Address Bar without refreshing the page in JavaScript.

There are basically two ways to change the URL displayed in the browser* through javascript without reloading the page.
  1. window.history.pushState(“object or string”, “Title”, “/new-url”);  
  2. window.history.replaceState(“object or string”, “Title”, “/another-new-url”);  
To learn more about this: Read Here