Get a different meta value with ajax when different elements are clicked

I figured it out myself thanks to this Q&A. The problem was with closures in loops.

Can’t really explain what happens but it works for me.

jQuery(document).ready(function($){
    $.ajax({
        url: ajaxurl,
        data: {
            'action':'ajax_action',
            'post_id' : 18
        },
        success:function(data) {
            var hero = JSON.parse(data);
            function createCallback( i ){
              return function(){
                $('.changing').html(hero[i]['description']);
              }
            }

            $(document).ready(function(){
              for(var i = 0; i < hero.length; i++) {
                $('.click-' + i).click( createCallback( i ) );
              }
            });
        }
    });
})