DEV Community

Discussion on: Daily Challenge #245 - Sort Santa's Reindeer

Collapse
 
jpantunes profile image
JP Antunes

JS

const sort_reindeer = lst => lst.sort((a,b) => a.substring(a.indexOf(' ')).localeCompare(b.substring(b.indexOf(' '))))