-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Closed
Labels
urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.whatwg-urlIssues and PRs related to the WHATWG URL implementation.Issues and PRs related to the WHATWG URL implementation.
Description
const url = new URL("http://domain?var=1&var=2&var=3");
const params = Array.from(url.searchParams);
// There is no `.clear()`
for (let param of url.searchParams) {
url.searchParams.delete( param[0] );
}
console.log(url.href) //-> http://domain/?
url.search = url.searchParams.toString();
console.log(url.href) //-> http://domain/Tested in Chrome and both correctly log the same (second) value.
Metadata
Metadata
Assignees
Labels
urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.whatwg-urlIssues and PRs related to the WHATWG URL implementation.Issues and PRs related to the WHATWG URL implementation.