code: function loadScript(src) {
    return new Promise(resolve => {
      const script = document.createElement('script');
      script.onload = resolve;
      script.src = src;
      document.head.appendChild(script);
    });
  }
docs: lazy load a script