I am seeking a refined solution to create a function that retrieves the names of legal drivers from a given array of people:
function getNamesOfLegalDrivers(people) {
}
const driverArray = [
{ name: 'John', age: 14 },
{ name: 'Joey', age: 16 },
{ name: 'Jane', age: 18 }
];
console.log(getNamesOfLegalDrivers(driverArray), '<-- should output names of individuals over 16 years old, like ["Joey", "Jane"]');