HF RL Explorer

Custom Sort Function in JavaScript

Custom Sort Function in JavaScript: a task in Terminal-Lego-15k (Harbor dataset). You need to implement a custom sorting function in JavaScript that sorts an array of strings based on a search substring. Items that start with the search substring should appear first in the sorted results, followed…

The task

You need to implement a custom sorting function in JavaScript that sorts an array of strings based on a search substring. Items that **start with** the search substring should appear first in the sorted results, followed by other items in alphabetical order.

Part of PrimeIntellect/Terminal-Lego-15k.