very interesting blog thanks for this. in ur array to object sort() comparism why using alot of return statement instead of one, one works just fyn for me, is there anything special about returning zero(0)
const names_of_employees = [ {name:'ahmad', age:30},{name: 'maaji', age: 21}, {name:'musa', age:16}, {name:'bulldozer', age:70} ]
let sort_names = names_of_employees.slice().sort(function (user1, user2){ if(user1.age < user2.age) return -1; return 0; why returning this })