jquery each loop do on first code example
Example 1: jquery each
//Array
$.each( arr, function( index, value ){
sum += value;
});
//Object
$.each( obj, function( key, value ) {
sum += value;
});
Example 2: jq each loop
$( "div" ).each(function( index ) {
//console.log( index )
modal_desc = $(this).length;
if(modal_desc > 20){
//code
}
});