What will be the result of the following code?
const people = [
{ name: 'Ana', age: 25 },
{ name: 'Luis', age: 21 }
];
const sorted = people.sort((a, b) => a.age - b.age);
console.log(sorted[0].name);
What will be the result of the following code?
const people = [
{ name: 'Ana', age: 25 },
{ name: 'Luis', age: 21 }
];
const sorted = people.sort((a, b) => a.age - b.age);
console.log(sorted[0].name);