Heres my code, which works but i feel like there is a more simple way doing this. The bold part is where i want to change.
interface properties {
age: number;
salary: number;
name: string;
}
let minSalary: any;
let maxSalary: any;
let list: properties[] = [
{name: "P", age: 12, salary: 100},
{name: "S", age: 80, salary: 12000},
{name: "Q", age: 25, salary: 80000},
{name: "W", age: 55, salary: 45000},
{name: "E", age: 32, salary: 25000},
{name: "V", age: 5, salary: 0}
];
**minSalary = Math.min.apply(Math, list.map( salaries => {
return salaries.salary;** // This is the code i want to make easier
}
));
console.log(minSalary);