I have a url that contains a parameter, which I want to remove. I have created an if...else
condition, but I would like to improve it in ES6.
if ( window.location.search.indexOf('&submit') > -1 ) {
window.location = urlBase + '/' + window.location.search;
} else {
window.location = urlBase + '/' + window.location.search + '&submit=1';
}
Thank you in advance.