@mudasobwa my ugly shot:
.sort(
(a,b) => [a, b].map(
(e) => e.slice(2).split("-").map(
(i) => i.length < 2 ? "0" + i : i
).join("-")
).reduce((a, b) => a > b ? -1 : 1)
)
Top-level
@mudasobwa my ugly shot: 2 comments
@willpraxis I get accustomed to that everything in Elixir is sortable in the expected way, including but not limited to arrays (lists) of four elements |
@willpraxis yeah, I thought about it, but I was unsure how JS wouls sort strings :)