I'm trying to sort an array of string in an angular application that for example contains :
names = ["Eve","Jhon","Maria","Jadon"] and I want to sort them in this order : ["Maria", "Eve", "Jadon", "Jhon"]
I tried
names.sort(); 
But this will order it into an  ascending order but for me I want to choose the order as I want it to be ! as if I have a table and I want to  sort it's header's items=["id","name","email","fullname","tel"] to ["name","id","email","tel","fullname"].
Do you have any idea?
 
     
     
    