I need help with making a function which I need to sort array of users names by a given value + alphabet. First I need to see the names starting with my value(also sorted by alphabet) and then the rest of the array sorted by alphabet.
For example:
const users = ["orel","or","boris","rory","dorel","conor","coral"];
value: "or"
the output I expect:
//users ["or","orel","boris","conor","coral","dorel","rory"]
I could manage which making the alphabet sorting but got stuck combining it with sorting by the given value. thanks by heart!