Skip to content

Instantly share code, notes, and snippets.

@czottmann
Created August 2, 2010 12:21
Show Gist options
  • Save czottmann/504557 to your computer and use it in GitHub Desktop.
Save czottmann/504557 to your computer and use it in GitHub Desktop.
jQuery.compareArray
jQuery.compareArray = function( array1, array2 ) {
var comparisons = $.map( array1, function( value, i ) {
return ( value === array2[ i ] );
});
comparisons = $.unique( comparisons );
return ( comparisons.length === 1 && comparisons[0] === true );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment