Categories
JavaScript

Sorting an array of Objects in JavaScript

If you have an array in JavaScript that doesn’t contain just simple numeric or string values, but objects with properties instead: var employees=[]; employees[0] = {name:”Petar”, age:32}; employees[1] = {name:”Nikola”, age:17}; employees[2] = {name:”Milutin”, age:58}; employees[3] = {name:”Slavisa”, age:62}; The employees array above is an array of objects with properties of different data types, string […]