XMLHttpRequest is deprecated. What to use instead?
<p>Trying to use a pure JS approach to check if I have a valid JS image url. I am getting a warning that <code>XMLHttpRequest</code> is deprecated. What is a better way to do this?</p>

<pre><code>urlExists(url) {
    const http = new XMLHttpRequest();
    http.open('HEAD', url, false);
    http.send();
    if (http.status !== 404) {
      return true;
    }
    return false;
  }
</code></pre>