function Sorting(arr, sortBy, direction) {
switch (sortBy) {
case "age":
return arr.sort((a, b) => (a.age > b.age ? direction : -direction));
case "name":
return arr.sort((a, b) => (a.full_name > b.full_name ? direction : -direction));
case "b_day":
return arr.sort((a, b) => (a.b_day > b.b_day ? direction : -direction));
case "country":
return arr.sort((a, b) => (a.country > b.country ? direction : -direction));
default:
return "missing parametr";
}
}