$('.block').height(function () {
return $(this).width();
});
.height( function(index, height) )
A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set
Problem with your code
this
below is the window
object not $('.block')
$('.block').height($(this).width());