I search a solution for solve this problem in JS. I've got an array with some objects, with a propery "name".
I would like to order this array by a user search value. For example if user search "th", i would like an array order name begin by "th"etc...
var arrayName = [];
var emp1 = {nom: "Thomas"};
var emp2 = {nom: "Anastasia"};
var emp3 = {nom: "Arnaud"};
var emp4 = {nom: "Thierry"};
arrayName.push(emp1);
arrayName.push(emp2);
arrayName.push(emp3);
arrayName.push(emp4);
arrayName.orderBy("th");
In this code, orderBy method will be good if return the array sort by "th" and so return first "Thierry" object and second "Thomas".
Thanks helping me !