Question 3
Consider the following JavaScript code:
let employees = [ { name: "Rahul", age: 28 }, { name: "Priya", age: 24 }, { name: "Amit", age: 32 }];employees.sort((a, b) => a.age - b.age);console.log(employees.map(e => e.name).join(" - "));What will be printed on the console?
Rahul - Priya - Amit
Priya - Rahul - Amit
Amit - Rahul - Priya
Priya - Amit - Rahul