My code was compiled to the following, and it works, but I do not know why. The variable that references the incrementing value is not included as an argument in the for loop.
var _loop2 = function _loop2() {
    var p = document.createElement('p');
    p.setAttribute('class', 'location__result');
    p.setAttribute('data-id', response.features[i].id);
    p.setAttribute('data-center', response.features[i].center);
    p.textContent = response.features[i].place_name;
    p.addEventListener('click', function () {
        endingInput.value = p.textContent;
        endingResults.style.display = "none";
        placeIconAndZoom(p, position);
    });
    endingResults.appendChild(p);
};
for (var i = 0, length = response.features.length; i < length; i++) {
    _loop2();
}
 
     
    