Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. var a=[['test':'1','test1':'2','test2':{'test3':'3','test4':'4'}],['test':'2','test1':'2','test2':{'test3':'1','test4':'2'}]];
  2.  
  3. a.sort(function (item1, item2) {
  4. if (item1.test2.test3 < item2.test2.test3) return -1;
  5. if (item1.test2.test3 > item2.test2.test3) return 1;
  6. return 0;
  7. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement