Problem understanding return
guys check out this fiddle :
its uses the filter function and the return statement , what i don't understand is the use of the return statement , whom is it returning what ??
The HTML :
-
<ul>
<li><strong>list</strong> item 1 - one strong tag</li>
<li><strong>list</strong> item <strong>2</strong> -
two <span>strong tags</span></li>
<li>list item 3</li>
<li>list item 4</li>
<li>list item 5</li>
<li>list item 6</li>
</ul>
and the Jquery code
$(document).ready(function(){
$( "li" )
.filter(function( index ) {
return $( "strong", this ).length === 1;
})
.css( "background-color", "red" );
});
i just don't get where the returning statement is returning to ...