Sort the number Array of Objects in JavaScript

Опубликовано: 09 Март 2026
на канале: codewithvenkats
2
0

Hello Dev's, in this video I spoke about the Sort the number Array of Objects in JavaScript.

let arrayObj = [
{ id: 1, age: 20 },
{ id: 2, age: 10 },
{ id: 3, age: 40 },
{ id: 4, age: 30 },
];

arrayObj.sort((a, b) = b.age - a.age);
console.log(arrayObj);

#interview , #javascript , #html, #css3,