Skip to content

Instantly share code, notes, and snippets.

@Kcko
Created January 22, 2017 09:40
Show Gist options
  • Save Kcko/41668319482abf58a1fd8eae6d0ea7d9 to your computer and use it in GitHub Desktop.
Save Kcko/41668319482abf58a1fd8eae6d0ea7d9 to your computer and use it in GitHub Desktop.
jQuery - reverse each
$(function(){
var reversedSet = $("li").get().reverse();
//Use get() to return an array of elements, and then reverse it
$(reversedSet).each(function(){
//Now we can plug our reversed set right into the each function. Could it be easier?
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment