Home > front end >  Cloest (' td, th ') and pushStack ($cells); Do not understand, ask
Cloest (' td, th ') and pushStack ($cells); Do not understand, ask

Time:09-19

(function ($) {
$. Fn. Column=function () {
Var $cells=$();
This. Each (function () {
Var $td=$(this). The closest (' td, th ');
If ($td. Length) {
Var colNum=$td [0]. CellIndex + 1;
Var $columnCells=$td
The closest (' table ')
Find (' td, th ')
Filter (' : the NTH - the child (' + colNum + ') ');
$cells=$cells. The add ($columnCells);
}
});
Return this. PushStack ($cells);
};
})(jQuery);
Cloest (' td, th) with td, th is what mean? I can only see cloest (" td ") or the closest () 'th' usage, said back a parent element, both in the parameters, what meaning be?

The final return this. PushStack ($cells); What does it mean? With the return $cells directly; Can't? If you have any influence on the DOM tree, return $cells; Cause what kind of impact?
Thank you teacher