code: function parseURL(url) {
    let urlLike;
  
    if (typeof URL === 'function') {
      urlLike = new URL(url);
    } else {
      urlLike = document.createElement('a');
      urlLike.setAttribute('href', url);
    }
  
    const { hostname, pathname, search } = urlLike;
  
    return { hostname, pathname, search };
  }
docs: This is a workaround - Today, there is no good URL polyfill for older browser - Instead of writing a URL parser, for older browser, we will use this <a href> trick to parse the URL