Two way to trim?

$('#mygreatform').submit(function(){
      $(this).find('input:text').each(function(){
            $(this).val($.trim($(this).val())); // vs $(this).val().trim();
      });
});

Someone can explain what is do that both trim first inside and second not?

Thanks