The url is something like this
../search/days=4&people=4&stars[]=1&stars[]=2
I want to remove the parameter stars[] which is multiple in my case. I tried using below script but it is removing only 1 instance of the parameter but not all.
var onlyUrl = window.location.href.replace(/&stars\[\]=\d+/, '');
Short & sweet solution is appreciated. Thank you in advance.