I am facing a problem with array sorting. I am trying to do a customized sort. I mean let's say if I take an array like the one below and I want to sort it according to my criteria. For example, I want my new sorted array will start the names which begin with letter 'h' and after this, it will go normally.
let names = ['monkey', 'ziraf', 'cat', 'hridoy','htido', 'bhuyan'];
I want my new sorted array like this:
names = ['hridoy', 'htido', 'bhuyan', 'cat', 'monkey', 'ziraf'];
Any ideas?