Skip to content

Instantly share code, notes, and snippets.

@jennschiffer
Last active August 29, 2015 14:01
Show Gist options
  • Save jennschiffer/b544f8670f0d4b4863b8 to your computer and use it in GitHub Desktop.
Save jennschiffer/b544f8670f0d4b4863b8 to your computer and use it in GitHub Desktop.
var jortSort = function( array ) {
// sort the array
var originalArray = array.slice(0);
array.sort( function(a,b){return a - b} );
// compare to see if it was originally sorted
for (var i = 0; i < originalArray.length; ++i) {
if (originalArray[i] !== array[i]) return false;
}
return true;
};
@rmetzler
Copy link

I don't get the &lt;. :-(

@jennschiffer
Copy link
Author

lol it was a typo, relax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment