sort array by property

PHOTO EMBED

Mon Sep 27 2021 10:22:22 GMT+0000 (Coordinated Universal Time)

Saved by @mathiasVDD

var sortByProperty = function (property) {
					return function (x, y) 
					{return ((x[property] === y[property]) ? 0 : ((x[property] > y[property]) ? 1 : -1));};
					};
					array.sort(sortByProperty('name'));
content_copyCOPY