How would you implement a basic JavaScript function to filter and sort an array of objects based on multiple properties?