Is it possible to remove parameter from query-string with js, I have tried below one unfortunately its works in browser console not in JS file.
var clean_uri = location.protocol + "//" + location.host+location.pathname;
window.history.replaceState({}, document.title, clean_uri);
what would be the best way to do it.