This is a performance benefit, as you no longer have to reach into the DOM for the necessary element, every time you would like to perform any manipulation.
Bad Example
function myFunc() {
$('.ele').hide();
$('.ele').height(30);
$('.ele').fadeIn();
}
Good Example
function myFunc() {
var $ele = $('.ele');
$ele.hide();
$ele.height(30);
$ele.fadeIn();
}
This is a performance benefit, as you no longer have to reach into the DOM for the necessary element, every time you would like to perform any manipulation.
Bad Example
Good Example