Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

More efficient, uses integers, and sortable in the table:

   console.table([...document.querySelectorAll('.fatitem table .athing')].map(el => ({place: el.textContent.trim(), score: parseInt(el.nextSibling.textContent)})).sort((a, b) => b.score - a.score))


with tie breakers

     console.table([...document.querySelectorAll('.fatitem table .athing')].map(el => ({place: el.textContent.trim(), score: parseInt(el.nextSibling.textContent)})).sort((a, b) => b.score - a.score || a.place.localeCompare(b.place)))




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: