title: How to loop URLSearchParams?
body: <p>I tried those two options, without any luck:</p>
  <pre class="lang-js prettyprint-override"><code>let url = new URL(window.location.href);
  let key = undefined;
  
  for (let k of url.searchParams) {
      if(url.searchParams[k] == postID) {
          key = k;
      }
  }
  </code></pre>
  <p>and</p>
  <pre class="lang-js prettyprint-override"><code>let url = new URL(window.location.href);
  const filteredItems = Object.keys(url.searchParams).filter(key =&gt;
    url.searchParams[key] == postID
  );
  let key = filteredItems.keys.first;
  </code></pre>
  <p>What is wrong?</p>