I have an array of objects that have TechType and ProductName attributes. This array is already sorted by TechType (not necessarily in alphabetical order); now in this sorted array it should be sorted in ascending order based on ProductName .
var products= [ { "TechType": "ADSL", "ProductName": " Zen ADSL Services", }, { "TechType": "ADSL", "ProductName": "ADSL Services", }, { "TechType": "T1", "ProductName": "T1-Voice", },{ "TechType": "T1", "ProductName": " Aviate T1-Voice", } ];
A sorted array must be
var products= [ { "TechType": "ADSL", "ProductName": " ADSL Services", }, { "TechType": "ADSL", "ProductName": "Zen ADSL Services", }, { "TechType": "T1", "ProductName": " Aviate T1-Voice", },{ "TechType": "T1", "ProductName": " T1-Voice", } ];
source share