Skip to content

Instantly share code, notes, and snippets.

@joecritch
Created December 1, 2010 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joecritch/723632 to your computer and use it in GitHub Desktop.
Save joecritch/723632 to your computer and use it in GitHub Desktop.
Console profiling test of looping through an array in jQuery to check a property
/// This...
if(featuredItems.filter(':animated').length) {
return false;
}
/// ... is twice as fast as this...
featuredItems.each(function() {
if($(this).is(':animated')) {
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment