JSFiddle - React, Tailwind, and code Playground

JavaScript

function cached(url){
        var test = document.createElement("img");
        test.src = url;
        return test.complete || test.width+test.height > 0;
    }
    var base_url = "http://www.google.com/images/srpr/nav_logo80.png"
    alert("Expected: true or false\n" +
          cached(base_url)
          + "\n\nExpected: false (cache-busting enabled)\n" +
          cached(base_url + "?" + new Date().getTime()));