When you so done with Stackoverflow sorting accepted answers wrong

twitter logo ・1 min read

Hold my beer, imma write a web extension

I'm aware some already exist, but nothing that respects the super odd anchoring system they have.

Scratch code so far is

[...document.querySelectorAll('#answers > div.answer')].reduce((acc, el) => [...acc, {anchor: el.previousElementSibling, answer: el, votes: +el.querySelector('div[itemprop="upvoteCount"]').getAttribute('data-value')}], []).sort((a, b) => b.votes - a.votes)
twitter logo DISCUSS
Classic DEV Post from Mar 1

What was your win this week?

Got to all your meetings on time? Started a new project? Fixed a tricky bug?

Jay Wick profile image
code junkie looking for their next fix

Let's talk shop 👩‍💻👨‍💻

Sign up (for free)