title: How can I combine two URLSearchParams in Angular/TypeScript?
body: <p>I have two <code>URLSearchParams</code> objects, and I want to make a third one of those two combined.</p>
  
  <p>For example, I could have</p>
  
  <pre><code>let params1 = new URLSearchParams();
  params1.set('page', 'one');
  params1.set('size', 'hundred');
  
  let params2 = new URLSearchParams();
  params2.set('orderBy', 'size');
  params2.set('order', 'asc');
  
  let params = params1 + params2; // yes, that's illegal, but how to do that?
  </code></pre>
  
  <p>and I need to have all 4 parameters in the params object.</p>
  
  <p>I wanted to iterate through the object key-value pairs using <a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/entries" rel="noreferrer">.entries()</a> method, but TypeScript hides this method. Here is what I've found in <code>lib.dom.d.ts</code> file:</p>
  
  <pre><code>interface URLSearchParams {
      append(name: string, value: string): void;
      delete(name: string): void;
      get(name: string): string | null;
      getAll(name: string): string[];
      has(name: string): boolean;
      set(name: string, value: string): void;
  }
  
  declare var URLSearchParams: {
      prototype: URLSearchParams;
      new (init?: string | URLSearchParams): URLSearchParams;
  };
  </code></pre>
  
  <p>So it looks like there's no possible option to iterate through <code>URLSearchParams</code> in TS. Any ideas?</p>