Answers for "sort function in typescript"

0

sort function in typescript

var items = [
  { name: "Edward", value: 21 },
  { name: "Sharpe", value: 37 },
  { name: "And", value: 45 },
  { name: "The", value: -12 },
  { name: "Magnetic", value: 13 },
  { name: "Zeros", value: 37 }
];
items.sort(function (a, b) {
  return a.value - b.value;
});
Posted by: Guest on April-01-2021

Code answers related to "sort function in typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language