I'm looking to return the skill below from a variable:
const skillsData = [
{ name: "React", value: 390 },
{ name: "CSS", value: 1200 },
{ name: "JavsScript", value: 540 },
{ name: "HTML", value: 1900 },
{ name: "CSS", value: 1278 },
];
Within a function, I am using the following:
let maxSkills = Math.max.apply(Math, skillsData.map(function(o) { return o.value; }))
This will obviously return a value, which has worked for one case, however what is the correct way to return the following 'name' key on the basis?
Furthermore, what would be a function to sort these in ascending value, so that you return HTML as the last in JSON?