Sort Javascript Array by Json object in array : I have an array 

    var a=[['test':'1','test1':'2','test2':{'test3':'3','test4':'4'}],['test':'2','test1':'2','test2':{'test3':'1','test4':'2'}]];

I can sort array using test and test 1 fields. But I have no idea to sort using test3 or test4. How can this array be sorted.