I have made this javascript code, but i think i am repeating my self, so any suggestions to make this code more better and optimized.
var countHeight = [];
$('.box').each(function() {
countHeight.push( $(this).outerHeight() );
});
var maxValueInArray = Math.max.apply(Math, countHeight);
$('.box').each(function() {
$(this).css('height', maxValueInArray+'px');
});