Skip to content

Instantly share code, notes, and snippets.

@sanx
Created January 14, 2014 23:30
Show Gist options
  • Save sanx/8428043 to your computer and use it in GitHub Desktop.
Save sanx/8428043 to your computer and use it in GitHub Desktop.
get lengths of the strings following a "=" sign on all anchor elements in a page, sorted by descending string length
Array.prototype.slice.call(document.querySelectorAll("a")).map(function(a){return a.href.split('=')[1].length}).sort().reverse();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment