Split and convert the numeric part to integer using parseInt()
then you can use those values to sort the records:
var arr = [{id: 588, name: "1 ex"},
{id: 592, name: "11 ex"},
{id: 607, name: "2 ex"},
{id: 580, name: "3 ex"},
{id: 596, name: "4 ex"}];
arr.sort(function (a, b) {
var aNum = parseInt(a.name);
var bNum = parseInt(b.name);
return aNum - bNum;
});
console.log(arr);