code: function URLSearchParams(/* init */) {
    anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
    var init = arguments.length > 0 ? arguments[0] : undefined;
    var that = this;
    var entries = [];
    var iteratorMethod, iterator, step, entryIterator, first, second, key;
  
    setInternalState(that, {
      type: URL_SEARCH_PARAMS,
      entries: entries,
      updateURL: null,
      updateSearchParams: updateSearchParams
    });
  
    if (init !== undefined) {
      if (isObject(init)) {
        iteratorMethod = getIteratorMethod(init);
        if (typeof iteratorMethod === 'function') {
          iterator = iteratorMethod.call(init);
          while (!(step = iterator.next()).done) {
            entryIterator = getIterator(anObject(step.value));
            if (
              (first = entryIterator.next()).done ||
              (second = entryIterator.next()).done ||
              !entryIterator.next().done
            ) throw TypeError('Expected sequence with length 2');
            entries.push({ key: first.value + '', value: second.value + '' });
          }
        } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
      } else {
        parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
      }
    }
  }
docs: `URLSearchParams` constructor https://url.spec.whatwg.org/#interface-urlsearchparams