Hacker News new | ask | show | jobs
by ravenstine 2457 days ago
Closest I could get:

`Array.from(document.querySelectorAll('table tbody tr')).sort((a, b) => { const yearA = parseInt(a.querySelector('td:nth-child(3)').innerText) || 2019, yearB = parseInt(b.querySelector('td:nth-child(3)').innerText) || 2019; return yearB - yearA; }).forEach(tr => { tr.remove(); document.querySelector('table tbody').insertAdjacentElement('afterbegin', tr) });`