In my opinion, instead of using the traditional if-else statements to switch CSS classes, using a conditional operator in conjunction with modClass
makes the code simpler, easier to read and saves on code lines.
Instead of doing the traditional way:
if (i < 5) {
jQuery('ul').removeClass('many-items');
} else {