I'm trying to implement a function in typescript where the user can pass an array of objects and a property of one of the objects and return the list order by the property the user have chosen.
function OrderByArray(values: any[], orderType: any) {
//TODO: implement code
return values;
}
Is any way to do it? I know how to sort an array but I don't know how to allow to send the typeof object and order by it.
Thanks!
property: string?year,name,carbrand.. I don't know if you can get me. @Martin