- From: Anne van Kesteren <notifications@github.com>
- Date: Wed, 28 Dec 2016 09:41:20 -0800
- To: whatwg/url <url@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 28 December 2016 17:41:54 UTC
That depends on whether the pattern is common. But you can simplify the above quite a bit: ```js const url = new URL("http://domain?var=1&var=2&var=3"); url.searchParams.forEach((value, name) => { url.searchParams.delete(name); if(someFilter(name, value)) { url.searchParams.append(name, value); } }) ``` It's a little unclear to me why the `forEach()` callback gets the arguments in such a weird order though. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/url/issues/183#issuecomment-269511994
Received on Wednesday, 28 December 2016 17:41:54 UTC