Parse Giphy API JSON in Javascript
<p>I would like to parse a response from the api giphy using Javascript
I would like to get the <strong>downsized url</strong> of all the <strong>images</strong> using the Giphy API</p>

<p>Here is what the json response looks like<br>
<a href="http://www.jsoneditoronline.org/?id=bbd7b24363fb7fa5035c22059b392bd7" rel="nofollow">http://www.jsoneditoronline.org/?id=bbd7b24363fb7fa5035c22059b392bd7</a></p>

<p>Here is my code that doesn't work that well</p>

<pre><code>const url = `http://api.giphy.com/v1/gifs/search?q=cat&amp;api_key=dc6zaTOxFJmzC`;
            var xhr = new XMLHttpRequest();
            xhr.onload = function () {
                if (xhr.readyState == 4 &amp;&amp; xhr.status == 200) {
                    var response = JSON.parse(xhr.responseText);
                    var data = response.data;
                    for (var i in data) 
                        console.log(i.url);
                }
            }
            xhr.open('GET', url, true); 
            xhr.send();
          } 
</code></pre>