Is it possible to explain why this code snippet throws such an error ECMA 6 is not an option as of now and I have also tried putting the inner $.each function in a closure IIFE that saves maps the value of i to an inner variable within the closure. Please help !
for(var i = 0; i < cityArray.length; i++) {
    $.each(_cityCards, function(index, item) {
        var cityName = $(this).attr('data-city');
        if(cityName == cityArray[i]) {
            $(this).css('transform','scale(1)').delay(500).show();
        }
    });
}
 
    