What will be shown when executing the following code?
const employees = [
{ name: 'Sara', salary: 3000 },
{ name: 'Juan', salary: 2000 }
];
employees.sort((a, b) => b.salary - a.salary);
console.log(employees[1].name);
What will be shown when executing the following code?
const employees = [
{ name: 'Sara', salary: 3000 },
{ name: 'Juan', salary: 2000 }
];
employees.sort((a, b) => b.salary - a.salary);
console.log(employees[1].name);